MY主控制器錯誤:錯誤:unpr未知提供商
var MyApp = angular.module('ionicApp', ['ionic', 'MobiNav', 'authFactory']);
控制器,功耗廠
MyApp.controller('AuthUser', ['$scope', 'authFactoryService', function ($scope, authFactoryService) {
$scope.showForm = true;
$scope.UserDataLogin = function() {
var loginData = {};
$scope.registration = {
userName: $scope.Auth.userName,
password: $scope.Auth.password,
confirmPassword: $scope.Auth.password
};
authFactoryService.SaveRegistration(registration);
window.scope = loginData;
};
}
]
);
這是單獨的文件工廠
var AuthService = angular.module('authFactory', []);
AuthService.factory('authFactoryService', [
'$http', '$q', '$scope', function ($http, $q, $scope) {
return {
SaveRegistration: function() {
var urlBase = 'http://localhost:48868/';
$http.post(urlBase + 'api/account/register', registration).then(function(response) {
$scope.savedSuccessfully = true;
$scope.message = "User has been registered successfully, you will be redicted to login page in 2 seconds.";
},
function(response) {
var errors = [];
for (var key in response.data.modelState) {
for (var i = 0; i < response.data.modelState[key].length; i++) {
errors.push(response.data.modelState[key][i]);
}
}
$scope.message = "Failed to register user due to:" + errors.join(' ');
});
}
};
}]);
錯誤,那麼我得到 錯誤:[$ injector:unpr] http://errors.angularjs.org/1.2.17/ $ injector/unpr?p0 = copeProvider%20%3C-%20%在錯誤(原生)24scope%20%3 C-%20authFactoryService
爲什麼它是無法加載authFactoryService服務
i如上嘗試 我收到以下錯誤消息。未捕獲的錯誤:[$ injector:nomod] http://errors.angularjs.org/1.2.17/$injector/nomod?p0=authFactory – 2014-09-28 09:13:32