export class AppController {
constructor(Guard, $state, $rootScope, $injector) {
'ngInject';
this.guard = Guard;
this.state = $state;
this.rootScope = $rootScope;
this.init();
}
init() {
this.pageTitle = this.state.current.ncyBreadcrumb.label;
this.help(this.state.current.url);
this.rootScope.$on('$locationChangeStart', (event, toState, toParams, fromState, fromParams) => {
this.guard.loadUser();
});
this.rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState, fromParams) => {
console.log(1);
});
}
}
есть такие события, при вызове this.state.go(state, {}, { reload: true }) события начинают дублироваться т.е this.guard.loadUser() и console.log(1) отработают 2 раза.
"angular": "^1.5.8",
"angular-ui-router": "0.4.2",