ng-click
Handler for click event
Description
The ng-click directive allows you to specify custom behavior when an element
is clicked.
Parameters
ng-click
Type: Expression
Restrict:
AElement: ANY
Priority:
0Description: Expression to evaluate upon click event. PointerEvent object is available as
$event.Example:
<div ng-click="$ctrl.greet($event)"></div>
Demo
<section ng-app>
<button class="btn btn-dark" ng-init="count = 0" ng-click="count = count + 1">
Increment
</button>
<span> count: {{count}} </span>
</section>
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.