我使用離子型框架1.3,並嘗試使用讀取手機通訊錄:
cordova plugin add cordova-plugin-contacts
而且
.controller('TestControlsCtrl', function($scope, $stateParams, $cordovaContacts) {
$scope.selectContacts = function() {
$cordovaContacts.find().then(function(allContacts) {
$scope.contacts = allContacts;
});
};
});
但我收到此錯誤
09-26 19:07:25.539 E/Web Console(4188): Error: [$injector:unpr] Unknown provider: $cordovaContactsProvider <- $cordovaContacts <- TestControlsCtrl
09-26 19:07:25.539 E/Web Console(4188): http://errors.angularjs.org/1.5.3/ $injector/unpr?p0=%24cordovaContactsProvider%20%3C-%20%24cordovaContacts%20%3C-%20TestControlsCtrl
09-26 19:07:25.539 E/Web Console(4188): at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:13438:12
09-26 19:07:25.539 E/Web Console(4188): at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17788:19
09-26 19:07:25.539 E/Web Console(4188): at Object.getService [as get] (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17941:39)
09-26 19:07:25.539 E/Web Console(4188): at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17793:45
09-26 19:07:25.539 E/Web Console(4188): at getService (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17941:39)
09-26 19:07:25.539 E/Web Console(4188): at injectionArgs (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17965:58)
09-26 19:07:25.539 E/Web Console(4188): at Object.instantiate (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:18007:18)
09-26 19:07:25.539 E/Web Console(4188): at $controller (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:23412:28)
09-26 19:07:25.539 E/Web Console(4188): at [object Object].appendViewElement (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:59900:24)
09-26 19:07:25.539 E/Web Console(4188): at Object.render (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:57893:41) at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:26794
NPM verion 3.8.6 節點版本5.11.0
我在做什麼錯?請幫助
這是Web控制檯錯誤? –
http://ngcordova.com/docs/common-issues/ – Phil