-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscopes.html
More file actions
56 lines (49 loc) · 1.72 KB
/
scopes.html
File metadata and controls
56 lines (49 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html ng-app="scopesApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="lib/angular.js"></script>
<script type="text/javascript" src="js/scopes.js"></script>
<link rel="stylesheet" type="text/css" href="css/base.css" />
<link rel="stylesheet" type="text/css" href="css/scopes.css" />
<title>Scopes</title>
</head>
<body>
<script type="text/ng-template" id="scopes">
<pre>root: {{root}}</pre>
<pre>one: {{one}}</pre>
<pre>two: {{two}}</pre>
<pre>three: {{three}}</pre>
<pre>one + two + three: {{one + two + three}}</pre>
</script>
<fieldset>
<legend>root scope</legend>
<div ng-include="'scopes'"></div>
</fieldset>
<fieldset>
<legend>oneCtrl scope</legend>
<div ng-include="'scopes'" ng-controller="oneCtrl"></div>
</fieldset>
<fieldset>
<legend>twoCtrl scope</legend>
<div ng-include="'scopes'" ng-controller="twoCtrl"></div>
</fieldset>
<fieldset>
<legend>threeCtrl scope</legend>
<div ng-include="'scopes'" ng-controller="threeCtrl"></div>
</fieldset>
<fieldset>
<legend>oneCtrl > twoCtrl scope</legend>
<div ng-controller="oneCtrl">
<div ng-include="'scopes'" ng-controller="twoCtrl"></div>
</fieldset>
<fieldset>
<legend>oneCtrl > threeCtrl > twoCtrl scope</legend>
<div ng-controller="oneCtrl">
<div ng-controller="threeCtrl">
<div ng-include="'scopes'" ng-controller="twoCtrl" ng-init="root='changed in template'"></div>
<pre>oneCtrl.root: {{$parent.root}}</pre>
</div>
</fieldset>
</body>
</html>