-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirsts.html
58 lines (58 loc) · 1.49 KB
/
firsts.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
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
57
58
<!DOCTYPE HTML>
<html>
<head>
<title>Two firsts</title>
<meta charset="UTF-8">
<style type="text/css">
pre span { background-color: lightblue; }
p { font-family: courier, sans-serif; }
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<p><script type="text/javascript">document.write(location.href)</script></p>
<table>
<tr>
<th>HTML</th>
<th>Javascript</th>
</tr>
<tr>
<td valign="top" style="border-right:1px dashed silver">
<pre>
<!doctype html>
<html ng-app="<span>firstApp</span>">
<head>
<title>First AngularJS App</title>
</head>
<body>
<div ng-controller="<span>FirstController</span>">
<span>Name:</span>
<input type="text" ng-model="first">
<input type="text" ng-model="last">
<button ng-click='updateMessage()'>Message</button>
<hr>
{{heading + message}}
</div>
<script src="http://code.angularjs.org/1.2.9/angular.min.js"></script>
<script src="js/first.js"></script>
</body>
</html>
</pre>
</td>
<td valign="top">
<pre>
var firstApp = angular.module('<span>firstApp</span>', []);
firstApp.controller('<span>FirstController</span>', function($scope) {
$scope.first = 'Some';
$scope.last = 'One';
$scope.heading = 'Message: ';
$scope.updateMessage = function() {
$scope.message = 'Hello ' + $scope.first +' '+ $scope.last + '!';
};
});
</pre>
</td>
</tr>
</table>
</body>
</html>