Answer the question
In order to leave comments, you need to log in
Why is the $stateChangeStart event not working?
I use webpack. The code is like this:
// main app
var app = angular.module('app', [
'ui.router',
'ngCookies',
'app.auth',
'app.advert',
'app.encyclopedia',
'app.post'
]);
app.run(function ($rootScope) {
$rootScope.$on('$stateChangeStart',
function(event, toState, toParams){
event.preventDefault();
console.log(123);
})
});
Answer the question
In order to leave comments, you need to log in
But because $stateChangeStart is deprecated, and you need to use $transitionts
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question