Requires the ngTouch
module to be installed.
This directive can fall back to using an ordinary click event, and so works on desktop browsers as well as mobile.
This directive also sets the CSS class ng-click-active
while the element is being held
down (by a mouse click or touch) so you can restyle the depressed element if you wish.
<ANY
ng-click="expression">
...
</ANY>
Param | Type | Details |
---|---|---|
ngClick | expression |
Expression to evaluate
upon tap. (Event object is available as |
<button ng-click="count = count + 1" ng-init="count=0">
Increment
</button>
count: {{ count }}
angular.module('ngClickExample', ['ngTouch']);