File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < title > AngularJS Workshop · Namespaces</ title >
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < link href ="/lib/bootstrap/css/bootstrap.css " rel ="stylesheet ">
7+ </ head >
8+ < body ng-app ="MyApp ">
9+ < div class ="container ">
10+ < h1 class ="page-header "> AngularJS Workshop · Namespaces</ h1 >
11+
12+ < div ng-controller ="PersonController ">
13+ < p > {{ person.name }} is {{ person.age }} years old</ p >
14+
15+ < button class ="btn " ng-click ="birthday() "> Get older</ button >
16+ </ div >
17+ </ div >
18+
19+ < script src ="/lib/angular/angular.js "> </ script >
20+ < script src ="js/namespaces.js "> </ script >
21+ </ body >
22+ </ html >
Original file line number Diff line number Diff line change 1+ angular . module ( 'MyApp' , [ ] )
2+ . controller ( 'PersonController' , function ( $scope ) {
3+ $scope . person = {
4+ name : "Warren Seymour" ,
5+ age : 28
6+ } ;
7+
8+ $scope . birthday = function ( ) {
9+ $scope . person . age += 1 ;
10+ } ;
11+ } ) ;
You can’t perform that action at this time.
0 commit comments