138
rated 0 times
[
140]
[
2]
/ answers: 1 / hits: 44872
/ 12 Years ago, fri, august 10, 2012, 12:00:00
Angular apps use the ng-click()
attribute rather than the the onclick
event.
Why is this?
More From » angularjs
Angular apps use the ng-click()
attribute rather than the the onclick
event.
Why is this?
ng-click holds an angular expression. Angular expressions are evaluated in the context of an Angular scope, which is bound to the element having the ng-click attribute or an ancestor of that element.
The Angular expression language doesn't include flow control statements and can't declare variables or define functions. These limitations mean templates can only access variables and run functions made available by a controller or directive.