我正在努力与科尔多瓦插件在我的离子应用程序。一整天都在Google上搜索,没有大的胜利。如何包含和使用科尔多瓦插件
这是我正在做的 - 在我的应用程序中用navbar目前打开一个网页。我发现,cordova-themeable可能工作了这一点
... ...但是
我安装了它
$ cordova plugin add cordova-plugin-themeablebrowser
OK,这是目前
$ cordova plugin list
cordova-plugin-camera 2.2.0 "Camera"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-themeablebrowser 0.2.15 "ThemeableBrowser"
cordova-plugin-whitelist 1.2.2 "Whitelist"
ionic-plugin-keyboard 2.2.0 "Keyboard"
现在,我正在努力在控制器功能中使用它
$scope.doStuff = function doStuff() {
cordova.ThemeableBrowser.open('http://apache.org', '_blank', {
...
,并呼吁它在我的.html文件
<ion-item ng-click="doStuff()">
我收到以下错误
ReferenceError: cordova is not defined at Scope.doStuff
我
的index.html,我有
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<script src="js/app.js"></script>
请帮忙,谢谢
您是否将cordova添加到您的项目中? –
@ matt93确保调用ionicPlatform.ready函数里面的插件代码 – Gandhi
@Gandhi谢谢,我将它添加到我的函数中:$ scope.doStuff = function doStuff(){ion.Platform.ready(function(){ cordova。 ThemeableBrowser.open('http://apache.org','_blank',{...但仍然 - cordova没有在离子实验室中定义,在模拟器中它什么都没做。我想知道是否有一些依赖失踪或者可能的方式我在我的html文件中调用它是错误的 – matt93