angular.js - Ionic2中如何调用Cordova插件?
某草草
某草草 2017-05-15 17:05:10
0
1
563

请问如何在基于Typescript的ionic2中调用cordova插件呢?
插件是自己写的,不能使用ionic-native。
如何获取插件的实例呢?比如导出插件叫plugin
根据网上一些说法先:

declear var window: any;

然后在代码中调用,比如在生命周期函数ionViewLoaded中:

window.plugin.someMethod();

但是无法获取到pluigin实例,请假如何调用?

某草草
某草草

reply all(1)
为情所困

Click window.cordova in Console to see what is included, and then search step by step. Most likely there is window.cordova.plugin(s)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template