问题
I'm attempting to use the ionic plugin cordova-plugin-dialogs
, the plugin is working and I am able to call navigator.notification.alert()
and create a native alert prompt but whenever my app builds, I get the following console error:
error TS2339: Property 'notification' does not exist on type 'Navigator'.
I read online that this could be related to types but I have confirmed that the types for this plugin are installed.
回答1:
The way I solved was to add this to my typings.json:
"dialogs": "github:apache/cordova-plugin-dialogs/types/index.d.ts"
My project is old and still use typings. I use grunt to build, so I instal the typings.
来源:https://stackoverflow.com/questions/55732082/error-property-notification-does-not-exist-on-type-navigator