How can I trigger an event when an angular JS route template has been loaded

后端 未结 1 1103
半阙折子戏
半阙折子戏 2020-12-29 06:51

Does anyone know how to trigger an event when an angular route has rendered its view? I\'d like to route the application and at the end of the template being rendered I woul

相关标签:
1条回答
  • 2020-12-29 07:36

    Does this do what you're after?

    $scope.$on('$routeChangeSuccess', function () {
      // run some code to do your animations
    });
    

    Go to http://docs.angularjs.org/api/ and take a look at $route (LHS menu under ngRoute module)

    Or take a look at this question I asked....AngularJS - Animate ng-view transitions

    0 讨论(0)
提交回复
热议问题