1

I have this:

$route.reload();

I would need to fire something just before template is rendered again, for example:

$("#someTab").click();

Thanks.

firstChild
  • 326
  • 2
  • 12
  • 1
    This link should help. This person had a similar problem and '$routeChangeSuccess' solved it. http://stackoverflow.com/questions/21866317/running-function-again-after-route-change-in-angularjs . Also it seems you are using JQuery in conjunction with Angular. I'm not saying this is wrong and it definitely can be done but you should probably be looking for an angular solution to your problems. Have a look at this http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background it might help. – BobDoleForPresident Apr 17 '15 at 13:56

1 Answers1

0

If you need to run a jQuery code, you need to use $timeout for your code works correctly:

$timeout(function() {
    $("#someTab").click();
});

Of course, you need to inject the $timeout service.

Joao Polo
  • 2,153
  • 1
  • 17
  • 26