标签: javascript angularjs angular-ui-router
我正在使用UI-Router,我希望每次更改状态时更改控制器中定义的变量
.run(function($rootScope) { $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){ //I want it here (eg: dctrl.elemOne = true;) }) })
请帮帮我