valkirilov
valkirilov

Reputation: 1853

AngularJS Event for view focus

I am searching for and AngularJS event to do some animation when I go to a specific view.

For now I use ng-init but I saw that if I go to my view with the browser BACK button init is not called (because the view partial is loading once).

So if you know how to call my own function when we go to a specific view I will be happy, Thanks!

Upvotes: 0

Views: 70

Answers (1)

Ben Lesh
Ben Lesh

Reputation: 108471

did you try $scope.$on('$routeChangeSuccess', function() {})?

(Alternatively, you can set it up on $rootScope if your doing so in a run() or a service call)

Upvotes: 1

Related Questions