search

Home  >  Q&A  >  body text

angular.js - $stateChangeSuccess事件在状态跳转的时候不执行?

我想利用$stateChangeSuccess事件里的参数进行做操作,但是$stateChangeSuccess总是不执行,请问$stateChangeSucces的使用有什么规范吗?初学请多赐教!

習慣沉默習慣沉默2745 days ago581

reply all(7)I'll reply

  • 迷茫

    迷茫2017-05-15 17:06:56

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

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 17:06:56

    console.log(toState.name) try it

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:06:56

    I feel like the parameters are written wrong

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-15 17:06:56

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

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:06:56

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

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-15 17:06:56

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

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-15 17:06:56

    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>

    reply
    0
  • Cancelreply