0
我有這樣的錯誤,我不知道爲什麼未知提供商AngularJS錯誤
var app = angular.module('starter', ['ionic', 'starter.controllers', 'ngCordova'])
.run(function($ionicPlatform, $cordovaSQLite, $rootScope, AppStart) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
$cordovaSQLite.deleteDB("my.db");
db = $cordovaSQLite.openDB("my.db");
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS preferences (id integer primary key, description string, value string)");
AppStart.init();
});
})
.factory("AppStart", function($scope, $cordovaSQLite) {
var query = "SELECT id, description, value FROM preferences";
return {
init: function() {
var res = "hello";
}
}
})
當運行我的代碼,我得到一個錯誤 ROR:[$注射器:unpr]未知提供商:$ scopeProvider < - $範圍< - AppStart
爲什麼即使我設置它,我也會得到一個未知的提供者。