2

I updated Visual Studio 2015 to TypeScript 1.6 and my Apache Cordova application broke. I'm getting errors with Ionic UIActionSheet Options cssClass. For example, the line:

cssClass: "class_action_sheet"

results in the error: TS2322 Build Type is not assignable to type 'IActionSheetOptions'.

I tried to add a flag to the project file to suppress the new strictness, but either I added it wrong, or it can't be fixed that way.

Any help would be greatly appreciated.

Gunnar
  • 339
  • 2
  • 13

1 Answers1

1

This is of the same type of problem addressed here.

This seems to be a reversal of 'type compatibility' premise, but discussing that won't solve the problem.

The easiest solution is to make sure your ionic.d.ts file is complete. There is a version on definitely typed currently that does contain a property for cssClass in action sheet options, however it is not a direct descendant of the .d.ts file you are currently using and this will imply some refactoring.

For example the action sheet options is ionic.actionSheet.IonicActionsheetOptions not Ionic.IActionSheetOptions.

Another option would be to extend the interface on your own by saying interface MyActionSheetOptions extends Ionic.IActionSheetOptions, then define cssClass.

This seems incorrect to me as it's not a true subset but merely trying to fix gaps in the ionic definition file.

Community
  • 1
  • 1