<script> function HelloCntl() { this.name = 'World'; } </script> <div ng:controller="HelloCntl"> Your name: <input type="text" ng:model="name" value="World"/> <hr/> Hello {{name}}! </div>
it('should change the binding when user enters text', function() { expect(binding('name')).toEqual('World'); input('name').enter('angular'); expect(binding('name')).toEqual('angular'); });
Take a look through the source and note:
input widget
which is bound to the greeting name text.name
variable which is in the root scope
.{{markup}}
, which binds the name variable to the greeting text.