Answer the question
In order to leave comments, you need to log in
How to find out which route the user is in?
I use ui-router, when switching between routes, I need to catch where the user is now.
Found function
$rootScope.$on('$stateChangeSuccess',
function (event, toState, toParams, fromState, fromParams){
// console.log(fromState.url);
// console.log(toState.url);
}
);
Answer the question
In order to leave comments, you need to log in
$rootScope.$on('$locationChangeStart', function() {
leftButtonTranslate();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question