Simon Hunt | d7c203c | 2014-12-09 16:51:49 -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 | <style> |
| 7 | span { |
| 8 | background-color: #cce; |
| 9 | } |
| 10 | </style> |
| 11 | </head> |
| 12 | <body ng-controller="MainCtrl as ctrl"> |
| 13 | |
| 14 | <input type="text" ng-model="ctrl.username"/> |
| 15 | You typed {{ctrl.username}} |
| 16 | |
| 17 | |
| 18 | <script type="text/javascript"> |
| 19 | angular.module('notesApp', []).controller('MainCtrl', [ |
| 20 | function () { |
| 21 | var self = this; |
| 22 | self.username = 'nothing'; |
| 23 | } |
| 24 | ]); |
| 25 | </script> |
| 26 | |
| 27 | </body> |
| 28 | </html> |