日期:2014-05-16  浏览次数:20302 次

AngularJS(2)PhoneCat Demo Basic

AngularJS(2)PhoneCat Demo Basic

Go on with the PhoneCat demo?https://github.com/angular/angular-phonecat?

3. Filtering Repeaters
?
Controller
Load the json data as before

Template
<input ng-model=“query”> This is just a input box with an identifier ‘query’

<ling-repeat="phone in phones | filter:query"]]>
http://code.angularjs.org/1.2.8/docs/api/ng.filter:filter

Data-binding, when page loads, AngularJS binds the name of the input box to a variable of the same name in the data model and keeps the 2 in sync.

AngularJS is really powerful here.

End-to-End Test
In the e2e/scenarios.js

There are 2 options to start the e2e test.
Start the Web Server, and visit?http://localhost:8000/test/e2e/runner.html

Or

Start the Web Server, and run the command
>./scripts/web-server.js?
>./scripts/e2e-test.sh