Simon Hunt | 335b247 | 2014-12-08 16:52:18 -0800 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html ng-app="notesApp"> |
| 3 | <head> |
| 4 | <title>Notes App</title> |
| 5 | <script src="../../tp/angular.js"></script> |
| 6 | </head> |
| 7 | <body ng-controller="MainCtrl as ctrl"> |
| 8 | |
| 9 | <div ng-repeat="(author, note) in ctrl.notes"> |
| 10 | <span class="label"> {{note.label}} </span> |
| 11 | <span class="author" ng-bind="author"></span> |
| 12 | </div> |
| 13 | |
| 14 | <script type="text/javascript"> |
| 15 | angular.module('notesApp', []).controller('MainCtrl', [ |
| 16 | function () { |
| 17 | var self = this; |
| 18 | self.notes = { |
| 19 | simon: { id: 1, label: 'First note', done: false}, |
| 20 | Thomas: { id: 3, label: 'Finished third note', done: true}, |
| 21 | alice: { id: 2, label: 'Second note', done: false} |
| 22 | }; |
| 23 | } |
| 24 | ]); |
| 25 | </script> |
| 26 | |
| 27 | </body> |
| 28 | </html> |