How to call the cordova plug-in in ionic2 based on Typescript?
The plug-in is written by myself and cannot use ionic-native.
How to get the instance of the plug-in? For example, the export plug-in is called plugin
. According to some opinions on the Internet:
declear var window: any;
Then call it in the code, such as in the life cycle function ionViewLoaded:
window.plugin.someMethod();
But the plugin instance cannot be obtained. How to call for leave?
为情所困2017-05-15 17:07:10
Click window.cordova in Console to see what is included, and then search step by step. Most likely there is window.cordova.plugin(s)