Skip to content

Instantly share code, notes, and snippets.

@duycuong87vn
Last active August 29, 2015 13:57
Show Gist options
  • Save duycuong87vn/9815149 to your computer and use it in GitHub Desktop.
Save duycuong87vn/9815149 to your computer and use it in GitHub Desktop.
.show-scope-demo.ng-scope,
.show-scope-demo .ng-scope{
border: 1px solid red;
margin: 5px;
}
<!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>
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