Tuesday, June 2, 2015

AngularJS - Combating AngularJS executing controller twice

AngularJS docs - ngController
Note that you can also attach controllers to the DOM by declaring it in a route definition via the $route service. A common mistake is to declare the controller again using ng-controller in the template itself. This will cause the controller to be attached and executed twice.

http://stackoverflow.com/questions/15535336/combating-angularjs-executing-controller-twice

No comments: