Created
March 27, 2014 18:10
-
-
Save duycuong87vn/9814326 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .show-scope-demo.ng-scope, | |
| .show-scope-demo .ng-scope{ | |
| border: 1px solid red; | |
| margin: 3px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html ng-app> | |
| <head> | |
| <meta name="description" content="[add your bin description]" /> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>AngularJS review</title> | |
| </head> | |
| <body> | |
| <div class="show-scope-demo"> | |
| <div ng-controller="greetCtrl"> | |
| Hello {{name}} ! | |
| </div> | |
| <div ng-controller="listCtrl"> | |
| <ol> | |
| <li ng-repeat="name in names">{{name.name}} from {{name.department}}</li> | |
| </ol> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function greetCtrl($scope){ | |
| $scope.name = 'World'; | |
| } | |
| function listCtrl($scope){ | |
| $scope.names = [ | |
| {'name':'Quang', | |
| 'department':'TDH'}, | |
| {'name':'Uoc', | |
| 'department':'TK'}, | |
| {'name':'TA', | |
| 'department':'PK'} | |
| ]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment