ui-router
ui-router copied to clipboard
how capture route error when $stateChangeError ?
config route
$stateProvider.state('categories All', {
url: '/categories',
templateUrl: 'categories/views/index.html',
resolve: {
loadRoute: app.loadRoute
}
});
init error
app.loadRoute = function ($q, $timeout,$location,Global) {
// Initialize a new promise
var deferred = $q.defer();
// Is country select
$timeout(deferred.reject);
return deferred.promise;
};
catch error
function(event, toState, toParams, fromState, fromParams) {
});
now how catch route error?
Example
/categories?test=1&value=2 how catch this route? and not the config route
thx.
Have you tried adding an event listener to the $stateChangeError event?