-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial7.js
More file actions
31 lines (27 loc) · 876 Bytes
/
tutorial7.js
File metadata and controls
31 lines (27 loc) · 876 Bytes
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
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.red {
color: red;
}
.green {
color: green;
}
</style>
</head>
<body>
<div ng-init="rebels = [
{name: 'Joe', profession: 'Bank Robber', weapon: 'a pistol', age: 21},
{name: 'Joseph', profession: 'Teacher', weapon: 'a book', age: 23},
{name: 'John', profession: 'musician', weapon: 'notepad', age: 45},
{name: 'Mary', profession: 'Burlesque dancer', weapon: 'shoes', age: 34},
];">
<select name = "" id="" ng-model="rebel" ng-options="rebel.name for rebel in rebels"> </select>
<p> You have selected: {{ rebel.name }} is {{ rebel.profession }} </p>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
</body>
</html>