Last active
August 29, 2015 13:57
-
-
Save duycuong87vn/9815149 to your computer and use it in GitHub Desktop.
This file contains 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: 5px; | |
} |
This file contains 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 class="ng-scope"> | |
<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> | |
aa | |
<div class="show-scope-demo"> | |
<div ng-controller="greetCtrl"> | |
Hello {{name}} ! | |
</div> | |
<div ng-controller="listCtrl"> | |
<ol> | |
<li ng-repeat="name in names">{{name}} from {{department}}</li> | |
</ol> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains 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, $rootScope){ | |
$scope.names = [ | |
'blackberry', 'thinkpad', 'mountainBike' | |
]; | |
$rootScope.department = 'my Dream'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment