A chapter in the HackPR warmup series.
- Node.js
- yo - 'npm install -g yo'
- angular-generator - 'npm install -g generator-angular'
- You can check out any step of the tutorial using git checkout step-?
- In each checkout you should do
npm update && bower install
in the root directory of the project. To install all the needed dependencies.
- Generate the application using
yo angular
- Say no to using Sass for this tutorial and say yes to the rest!
- Now we have the initial generator-angular skeleton app.
- Run the application by executing the following command
grunt serve
- Trimmed down the application to a mere static page
- First data binding:
- Data-binding is an automatic way of updating the view whenever the model changes, as well as updating the model whenever the view changes. This is awesome because it eliminates DOM manipulation from the list of things you have to worry about.
- Setup an initial array of friends with ngInit
- Use ngRepeat to bind the array of friends a generate the needed markup depending on the number of elements.
- Add text box with searchText bound to the model.
- Add the filter to the ngRepeat expression.