angular.directive.ng:watch

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

Description

The ng:watch allows you watch a variable and then execute an evaluation on variable change.

Dependencies

Usage

<ANY ng:watch="expression">
   ...
</ANY>

Parameters

Example

Notice that the counter is incremented every time you change the text.

<div ng:init="counter=0" ng:watch="name: counter = counter+1"> <input type="text" name="name" value="hello"><br/> Change counter: {{counter}} Name: {{name}} </div>