-
Notifications
You must be signed in to change notification settings - Fork 0
/
angulartutorial15.html
44 lines (38 loc) · 957 Bytes
/
angulartutorial15.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
<!doctype html>
<html ng-app="app15" ng-cloak>
<head>
<title>AngularJS Tutorial 15</title>
<style>
[ng\:cloak], [ng-cloak], .ng-cloak {
display: none;
}
.thick {
font-weight: bold;
}
</style>
</head>
<body>
<div ng-controller="mainCtrl">
<button ng-click="getData()">Get Data</button>
<br><br>
<!-- Display raw JSON -->
{{players}}
<!-- Put JSON in a list -->
<ul>
<li ng-repeat="player in players">
{{ player.name + " hit " + player.hr +
" Home Runs"}}
</li>
</ul>
<br>
Translate :
<input type="text" ng-model="wordsToTranslate"/>
<br><br>
<button ng-click="translate()">Translate</button>
<br><br>
{{translated}}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script src="js/exam15.js"></script>
</body>
</html>