Created
July 29, 2015 16:44
-
-
Save pstjvn/91639531b999f8cfec2a 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
<!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