简体   繁体   English

直接从 ionic2 typescript 组件访问 Cordova 插件

[英]Access Cordova plugins directly from ionic2 typescript components

I am creating new Ionic2 typescript application.我正在创建新的 Ionic2 打字稿应用程序。 Few of the required native access plugins are not available in ionic native till now(Routed device check plugin, Read SMS plugins etc).到目前为止,很少有必需的本地访问插件在 ionic native 中不可用(路由设备检查插件,读取短信插件等)。 So i required to use cordova plugins directly with out intervention of ionic native class and injection formalities.所以我需要直接使用cordova插件而不需要离子原生类和注入程序的干预。 your suggestions are appreciable.你的建议是可观的。 thanks谢谢

There is absolutely nothing to stop you from using these plugins.绝对没有什么可以阻止您使用这些插件。 Just tell typescript that they exist like so:只需告诉打字稿它们像这样存在:

declare var rootdetection:any; 

If you want to be proficient about it, writing your typing(an interface with all the plugins functionality) for the plugin and add it to your project如果您想精通它,请为插件编写您的输入(具有所有插件功能的界面)并将其添加到您的项目中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM