# angular.directive.ng:change

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

## Description

The directive executes an expression whenever the input widget changes.

## Usage

    <INPUT ng:change="expression">
       ...
    </INPUT>

### Parameters

- `expression – {expression} –`

  to execute.

## Example

      <div ng:init="checkboxCount=0; textCount=0"></div>
      <input type="text" name="text" ng:change="textCount = 1 + textCount">
         changeCount {{textCount}}<br/>
      <input type="checkbox" name="checkbox" ng:change="checkboxCount = 1 + checkboxCount">
         changeCount {{checkboxCount}}<br/>

       it('should check ng:change', function(){
         expect(binding('textCount')).toBe('0');
         expect(binding('checkboxCount')).toBe('0');

         using('.doc-example-live').input('text').enter('abc');
         expect(binding('textCount')).toBe('1');
         expect(binding('checkboxCount')).toBe('0');

         using('.doc-example-live').input('checkbox').check();
         expect(binding('textCount')).toBe('1');
         expect(binding('checkboxCount')).toBe('1');
       });