I am working my way through "AngularJS Starter" which is a 51 page book by Dan Menard. Some of the syntax examples in his first example of a view include:
- Here is a typical ng-repeat loop with a filter which refines how the results are ordered.
<li ng-repeat='note in chapter.notes | orderBy"id"'>
- This could be done inside the loop:
<p>{{note.content}}</p>
- This could be a link inside the loop:
<a href ng-click='onDelete(note.id)'>delete</a>
- A link to another route:
<a href='#/addNote/{{chapter.id}}'>add note</a>
- Showing or hiding copy conditionally:
<span ng-show='chapter.notes.length == 1'>note</span>
<span ng-hide='chapter.notes.length == 1'>notes</span>
No comments:
Post a Comment