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?
Click window.cordova in Console to see what is included, and then search step by step. Most likely there is window.cordova.plugin(s)