forked from shyamseshadri/angularjs-up-and-running
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng-repeat-object.html
38 lines (36 loc) · 897 Bytes
/
ng-repeat-object.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
<!-- File: chapter2/ng-repeat-object.html -->
<html ng-app="notesApp">
<head><title>Notes App</title></head>
<body ng-controller="MainCtrl as ctrl">
<div ng-repeat="(author, note) in ctrl.notes">
<span class="label"> {{note.label}}</span>
<span class="author" ng-bind="author"></span>
</div>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.js">
</script>
<script type="text/javascript">
angular.module('notesApp', [])
.controller('MainCtrl', [function() {
var self = this;
self.notes = {
shyam: {
id: 1,
label: 'First Note',
done: false
},
Misko: {
id: 3,
label: 'Finished Third Note',
done: true
},
brad: {
id: 2,
label: 'Second Note',
done: false
}
};
}]);
</script>
</body>
</html>