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 | {{ctrl.message}} AngularJS. |
| 9 | |
| 10 | <button ng-click="ctrl.changeMessage()"> |
| 11 | Change Message |
| 12 | </button> |
| 13 | |
| 14 | <script type="text/javascript"> |
| 15 | angular.module('notesApp', []) |
| 16 | .controller('MainCtrl', [function () { |
| 17 | var self = this; |
| 18 | self.message = 'Hello'; |
| 19 | self.changeMessage = function () { |
| 20 | self.message = 'Goodbye' |
| 21 | }; |
| 22 | }]); |
| 23 | </script> |
| 24 | |
| 25 | </body> |
| 26 | </html> |