The app I'm writing is using the resolve property in the main UI router state. It tries to resolve to a list of things, using a factory that uses $http. So I was trying to implement error handling, I changed my server to return a 404 status, and added thus lines:
$rootScope.$on('$stateChangeError', function(event) {
$state.go('404');
});
as Nate Abele explained here: Angular UI router handling 404s
Now the app do try to change the state to my 404 state, but a very strange loop occurred. The app keep trying to resolve the failed factory from the resolve property. Haven't figured up why until now.
Any suggestions ? Thanks.
resolveand 404 state definition, and anything else you think would, help us. The question you are referencing has no approved answers. C404state, by any chance, descend from the main state that contains the resolve?event.preventDefault()