-
Notifications
You must be signed in to change notification settings - Fork 0
/
angulartutorial1.html
40 lines (29 loc) · 1.08 KB
/
angulartutorial1.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
<!DOCTYPE html>
<html ng-app="app1" ng-init="person = {fName: 'Derek', lName: 'Banas'};
capitals = [{city: 'Montgomery', state: 'Alabama'}, {city: 'Juneau', state: 'Alaska'}, {city: 'Phoenix', state: 'Arizona'}]">
<head>
<title>AngularJS</title>
</head>
<body>
<div ng-controller="ctrl1">
<span>Values :</span>
<input type="text" ng-model="first"></input>
<input type="text" ng-model="second"></input>
<button ng-click="updateValue()">Sum</button>
{{calculation}}
<p>5 + 5 = {{5+5}}</p>
<p>Your first value is {{first}}</p>
<p>Your second value is <span data-ng-bind="second"></span></p>
<p>{{person.fName + "" + person.lName}} you entered {{first + " and " + second}}</p>
<ul>
<li ng-repeat="capital in capitals">
{{'City : ' + capital.city + ', State : ' + capital.state}}
</li>
</ul>
</div>
<!-- Load the AngularJS library -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<!-- Load the JS Module -->
<script src="js/exam1.js"></script>
</body>
</html>