Skip to content

Instantly share code, notes, and snippets.

@pstjvn
Created July 29, 2015 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pstjvn/91639531b999f8cfec2a to your computer and use it in GitHub Desktop.
Save pstjvn/91639531b999f8cfec2a to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example23-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
</head>
<body>
<div ng-app="myapp">
<div ng-controller="Main as m">
<div>{{name}}</div>
<div>{{m.name}}</div>
<input ng-model="name" />
<input ng-model="m.name" />
<hr />
<div ng-controller="Test">{{name}}</div>
<div ng-controller="Test as t">{{name}}</div>
<div ng-controller="Test">{{m.name}}</div>
<div ng-controller="Test as t">{{t.name}}</div>
<hr />
<div ng-controller="Test2">{{name}}</div>
<div ng-controller="Test2 as t2">{{name}}</div>
<div ng-controller="Test2">{{m.name}}</div>
<div ng-controller="Test2 as t2">{{t2.name}}</div>
</div>
</div>
<script>
angular.module('myapp', [])
.controller('Main', ['$scope', function($scope) {
$scope.name = 'Peter';
this.name = 'THISPeter';
}])
.controller('Test', ['$scope', function($scope) {
$scope.name = 'Sasho';
this.name = 'THISSasho';
}])
.controller('Test2', ['$scope', function($scope) {
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment