Dil*_*ttu 2 angularjs ionic-framework ngcordova
创建了一个测试项目,尝试从ngCordova中获取$ cordovaFile,但在将一个$ cordovaFile 注入其中一个控制器并运行xcode项目之后,我看到了未知的提供程序错误.
.controller('DashCtrl', function($scope,$cordovaFile) {})
Run Code Online (Sandbox Code Playgroud)
我真的没有看到弹出这个错误的方法.
使用以下方法创建了一个新项目
1. ionic start writefile
2. platform ios is added by default (using mac)
3. cordova plugin add cordova-plugin-file - added file plugin using ngcordova source
4. ionic build ios
5. Ran the project using xcode to run on simulator.
Run Code Online (Sandbox Code Playgroud)
调试问题,但在社区上发布可能有助于我更快地解决问题.
Shr*_*hri 10
首先使用安装插件
bower install -SF ngCordova
Run Code Online (Sandbox Code Playgroud)
包括ng-cordova.js
来自dist
所包含的ngCordova
库的目录,在您的index.html
然后在您的应用中加入"ngCordova"
angular.module('myApp', ['ngCordova'])
Run Code Online (Sandbox Code Playgroud)