AngularJS Developer Question: Download Questions PDF
What is ng-click directive?
Answer:
ng-click directive represents a AngularJS click event.
In below example, we've added ng-click attribute to a HTML button and added an expression to updated a model. Then we can see the variation.
<p>Total click: {{ clickCounter }}</p></td>
<button ng-click = "clickCounter = clickCounter + 1">Click Me!</button>
In below example, we've added ng-click attribute to a HTML button and added an expression to updated a model. Then we can see the variation.
<p>Total click: {{ clickCounter }}</p></td>
<button ng-click = "clickCounter = clickCounter + 1">Click Me!</button>
Download AngularJS Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me what is $rootScope and how does it relate to $scope? | Explain the advantages of AngularJS? |