angular.module.ng.$compileProvider.directive.ngClick

Description

The ngClick allows you to specify custom behavior when element is clicked.

Usage

as attribute
<ANY ng-click="{expression}">
   ...
</ANY>
as class
<ANY class="ng-click: {expression};">
   ...
</ANY>

Parameters

Example

 <button ng-click="count = count + 1" ng-init="count=0">
   Increment
 </button>
 count: {{count}}
  it('should check ng-click', function() {
    expect(binding('count')).toBe('0');
    element('.doc-example-live :button').click();
    expect(binding('count')).toBe('1');
  });