-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path18.shared-scope.html
24 lines (22 loc) · 1.12 KB
/
18.shared-scope.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<title>Shared Scope</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script type="text/javascript" src="18.shared-scope.js"></script>
</head>
<body ng-app="app">
<div class="container" ng-controller="sample">
Controller : a = {{a}}, b = {{b}}<br>
Modify a from controller: <input type="text" ng-model="a"><br>
<button ng-click="changeValueB()">Change Value B</button>
<hr>
Directives1 Instance 1: <div message></div><br>
Directives1 Instance 2: <div message></div><br>
Directives2 Instance 1: <div message1></div><br>
</div>
</body>
</html>