Here is the state defined in appRouteConfig.js
, where I am using $promise
to verify userList:
.state('userAccounts',{
url:'/userAccounts',
controller:'UserAccount',
resolve:{
registerService: "registerService",
userList: function(registerService){
return registerService.AllUser().$promise;
}
},
templateUrl:'UserAccounts/UserAccountsView.html'
})
This section shows the contents of registerService.js
:
AllUser: function(){
return $http.get('api/allUser');
}
Interestingly, without using $promise
, everything functions as expected.
I am curious about why the usage of $promise here is causing issues. If this explanation is unclear, please leave a comment.