why $routeChangeSuccess never gets called?

后端 未结 2 1647
一生所求
一生所求 2020-12-15 20:22

I am doing something similar to below on my app but I am just not able to get the routeChangeSuccess event.

var myapp = angular.module(\'myapp\', [\"ui.rout         


        
2条回答
  •  误落风尘
    2020-12-15 20:37

    Please, check this wiki: State Change Events. An extract:

    • $stateChangeSuccess - fired once the state transition is complete.

      $scope.$on('$stateChangeSuccess',
      function(event, toState, toParams, fromState, fromParams){ ... })

    So instead of the $routeChangeSuccess use the $stateChangeSuccess.

    To get more detailed information about all available events, check the wiki Events. Here you can find that the suitable for you, could be event $viewContentLoaded...

提交回复
热议问题