直接从ionic2 typescript组件访问Cordova插件 [英] Access Cordova plugins directly from ionic2 typescript components

查看:159
本文介绍了直接从ionic2 typescript组件访问Cordova插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建新的Ionic2打字稿应用程序。迄今为止,很少有所需的本机访问插件在离子本机中不可用(路由设备检查插件,读取SMS插件等)。所以我需要直接使用cordova插件,无需离子本地类和注入手续。你的建议很明显。谢谢

I am creating new Ionic2 typescript application. Few of the required native access plugins are not available in ionic native till now(Routed device check plugin, Read SMS plugins etc). So i required to use cordova plugins directly with out intervention of ionic native class and injection formalities. 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

这篇关于直接从ionic2 typescript组件访问Cordova插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆