Description
The ng:watch
allows you watch a variable and then execute
an evaluation on variable change.
Usage
<ANY ng:watch="expression">
...
</ANY>
Parameters
expression – {expression} –
to eval.
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>
it('should check ng:watch', function(){
expect(using('.doc-example-live').binding('counter')).toBe('2');
using('.doc-example-live').input('name').enter('abc');
expect(using('.doc-example-live').binding('counter')).toBe('3');
});