1
Have State Route:Угловые JS не работает решимость
.state('stateProfile', {
url: '/Profile',
views: {
"ContentContainer": {
templateUrl: '/Navigation/Profile',
controller: AuthController,
resolve: {
message: function (AuthService) {
return AuthService.GetMessage();
}
}
}
Это моя служба:
var AuthService = function ($timeout, $q, $location) {
return{
GetMessage : function() {
return "Hello";
}
}
};
AuthService.$inject = ['$timeout', '$q', '$location'];
Контроллер:
var AuthController = function (message, $q, $location, $timeout) {
console.log('auth work');
console.log(message);
};
AuthController.$inject = ['message', '$q', '$location', '$timeout'];
Когда я звоню, ничего не происходит ОЧЕРК. Но если я изменю свое решение:
resolve:
{
message: function (AuthService) {
return "Test resolve";
}
Тогда все работает. Почему это не работает?