科尔多瓦插件不能与离子工作

问题描述:

我建立了在角和AVE离子应用从来没有能够得到插件工作。

I am building out an Ionic app in Angular and ave never been able to get plugins to work.

作为一个例子,我一直在使用状态栏插件这里描述的尝试:

As an example, I have tried using the statusbar plugin as described here:

http://ionicframework.com/tutorials/fullscreen-apps/

但它仍然显示在我的应用程序。我想:

But it still shows in my app. I tried:

$ cordova plugin add org.apache.cordova.statusbar

,然后科尔多瓦prepare,离子运行IOS,仍然没有运气。

and then "cordova prepare", "ionic run ios" and still no luck.

该插件当我输入我可以上市。

The plugins I get listed when I type

$ cordova plugin list

com.ionic.keyboard 1.0.2 "Keyboard"
org.apache.cordova.console 0.2.10 "Console"
org.apache.cordova.device 0.2.11 "Device"
org.apache.cordova.statusbar 0.1.7 "StatusBar"

我也是用咕嘟咕嘟。我有所有我的dev的工作文件夹,然后一饮而尽移动,它编译成/ DIST文件夹从那里供应。我是pretty确保插件是完全跨移动,就是有没有什么地方我应该检查的参考?

I also am using Gulp. I have a folder with all my dev work in, and gulp moves and compiles it into a /dist folder from whence it is served. I'm pretty sure the plugins are moved across perfectly, is there anywhere I should check the references?

任何想法如果你要使用插件科尔多瓦用离子做点什么?

Any ideas if there is something you have to do in order to use Cordova plugins with Ionic?

这个问题的答案是,我不得不添加

The answer to this was that I had to add

<script src="cordova.js"></script>

我的网页,上面只是我的脚本。

to my page, just above my scripts.

请注意这个文件似乎并不在开发过程中存在,它必须在运行时或某事被注入...这就是为什么我可以解决这个问题。希望这可以帮助别人!

Please be aware this file doesnt seem to exist during development, it must be injected at runtime or something... which is why I could solve it. Hope this helps someone!