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:
Post a Comment