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.