2
Error: [$injector:unpr] Unknown provider: mvProfileCtrlProvider <- mvProfileCtrl
在我的錯誤
,我已經確信,它包含在我的腳本,並訪問(我可以從chrome-debugger > sources > mvProfileCtrl.js
打開它),所以它是可用於參考我猜。但還是這裏有兩個相關的文件:
angular.module('app').controller('navBarLoginController',function($scope,$http,mvIdentity,mvNotifier,mvAuth,mvProfileCtrl,$location) {
$scope.identity = mvIdentity;
$scope.signin = function(username,password) {
mvAuth.authenticateUser(username,password).then(function(success){
if(success){
mvNotifier.notify('You have successfully signed in!');
}else{
mvNotifier.notify('Username/Password combination incorrect');
}
})
}
var profile = mvProfileCtrl;
$scope.update = function(){
profile.listen(mvIdentity.currentUser);
}
$scope.signout = function() {
mvAuth.logoutUser().then(function() {
$scope.username = "";
$scope.password = "";
mvNotifier.notify('You have successfully signed out!');
$location.path('/');
})
}
})
和 -
angular.module('app').controller('mvProfileCtrl', function($scope, mvAuth, mvIdentity, mvNotifier) {
$scope.mvIdentity = mvIdentity;
$scope.update = function() {
console.log("" + $scope.updateemail + " -- " + test);
var newUserData = {
username: $scope.updateemail,
firstName: $scope.updatefname,
lastName: $scope.updatelname
}
if($scope.updatepassword && $scope.updatepassword.length > 0) {
newUserData.password = $scope.updatepassword;
}
mvAuth.updateCurrentUser(newUserData).then(function() {
$('#profileModal').modal('toggle');
mvNotifier.notify('Your user account has been updated');
}, function(reason) {
mvNotifier.error(reason);
})
}
return {
listen : function(currentUser) {
if (!currentUser) return;
$scope.updateemail = currentUser.username;
$scope.updatefname = currentUser.firstName;
$scope.updatelname = currentUser.lastName;
console.log("--> " + $scope.updateemail + " -- " + test);
}
}
});
和腳本文件 - 在這裏
script(type="text/javascript", src="/vendor/jquery/dist/jquery.js")
script(type="text/javascript", src="/vendor/toastr/toastr.js")
script(type="text/javascript", src="/vendor/angular/angular.js")
script(type="text/javascript", src="/vendor/angular-resource/angular-resource.js")
script(type="text/javascript", src="/vendor/angular-route/angular-route.js")
script(type="text/javascript", src="/vendor/bootstrap/dist/js/bootstrap.js")
script(type="text/javascript", src="/vendor/bootstrap/js/dropdown.js")
script(type="text/javascript", src="/app/app.js")
script(type="text/javascript", src="/plugins/backstretch/jquery.backstretch.min.js")
script(type="text/javascript", src="/plugins/bxslider/jquery.bxslider.min.js")
script(type="text/javascript", src="/plugins/bxslider/jquery.bxslider.min.js")
script(type="text/javascript", src="/app/account/navBarLoginController.js")
script(type="text/javascript", src="/app/common/mvNotifier.js")
script(type="text/javascript", src="/app/account/mvIdentity.js")
script(type="text/javascript", src="/app/account/mvauth.js")
script(type="text/javascript", src="/app/account/mvUser.js")
script(type="text/javascript", src="/app/admin/mvUserListCtrl.js")
script(type="text/javascript", src="/app/account/mvSignupCtrl.js")
script(type="text/javascript", src="/app/account/mvProfileCtrl.js")