angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

angularjs ng-class method is getting invoked multiple times

Open phillycoder opened this issue 13 years ago • 2 comments

In this example, i got 2 ng-class, each calling different controller method, for some reason each method get called 3 times, Any idea? Possible bug?

http://jsfiddle.net/uDPHL/72/

Also if i have collection of 10 models to build a table, ng-class method getting called more than 10 times,

phillycoder avatar Apr 11 '13 18:04 phillycoder

@phillycoder this is not a bug, this is how data binding works in AngularJS. This SO question has an excellent answer with more details by Misko: http://stackoverflow.com/q/9682092/1418796

pkozlowski-opensource avatar Apr 11 '13 18:04 pkozlowski-opensource

Thanks for the quick update,I will check that SO thread.

phillycoder avatar Apr 11 '13 18:04 phillycoder