angular.js - $stateChangeSuccess event not executed when state jumps?
習慣沉默
習慣沉默 2017-05-15 17:04:56
0
7
605

I want to use the parameters in the $stateChangeSuccess event to perform operations, but $stateChangeSuccess is always not executed. Are there any regulations for the use of $stateChangeSucces? Please give me some advice if you are a beginner!

習慣沉默
習慣沉默

reply all(7)
迷茫

No problem is found in the code, you can check whether your run file has been imported

Peter_Zhu

console.log(toState.name) try it

伊谢尔伦

I feel like the parameters are written wrong

世界只因有你

There is no problem with the code in the picture, the event will be triggered, but the problem lies elsewhere.

伊谢尔伦

I also encountered this situation. Later I checked and found out that it was because I forgot to add dependencies in the module

漂亮男人

And I finally found that the way to write 1.xx of ui.router 0.xx seems to be different

世界只因有你

I also encountered this problem. I have been looking for the problem for a long time. There is no problem with the code. Just change angular-ui-router to the stable version. I started using the beta version and the current stable version is 0.4.2

<script src="http://cdn.bootcss.com/angular-ui-router/0.4.2/angular-ui-router.min.js"></script>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template