ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

how capture route error when $stateChangeError ?

Open jcsena opened this issue 11 years ago • 1 comments

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.

jcsena avatar Feb 27 '15 21:02 jcsena

Have you tried adding an event listener to the $stateChangeError event?

eddiemonge avatar Jun 11 '15 00:06 eddiemonge