AngularJS ng-click Instruction
AngularJS Examples
Each time the button is clicked, the count variable is automatically incremented by 1:
<
button
ng-click="count = count + 1"
ng-init=
"count=0"
OK
<
/button
Try it »
Definition and Usage
ng-click The directive tells AngularJS the action to take when the HTML element is clicked.
Syntax
<
element
ng-click=
"expression"
<
/elementAll HTML elements are supported.
Parameter value
| Value | Description |
|---|---|
| expression | The expression to execute when the element is clicked. |
AngularJS Reference Manual