-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path09-module-alt-controllers.html
More file actions
35 lines (34 loc) · 1022 Bytes
/
09-module-alt-controllers.html
File metadata and controls
35 lines (34 loc) · 1022 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
32
33
34
35
<!DOCTYPE html>
<html ng-app="demoApp">
<head>
<title>Angular Demo</title>
</head>
<body>
<h1>Hello Module</h1>
filter: <input ng-model="filterText" />
<div ng-controller="SimpleController">
<ul>
<li ng-repeat="item in items | filter:filterText | orderBy:'name'">
{{ item.name }} ({{ item.director }})
</li>
</ul>
</div>
<script src="vendor/angular.min.js"></script>
<script>
var demoApp = angular.module('demoApp', []);
var controllers = {};
controllers.SimpleController = function ($scope) {
$scope.items = [
{ name: 'Pulp Fiction', director: 'Tarantino'},
{ name: 'Jackie Brown', director: 'Tarantino'},
{ name: 'Shining, The', director: 'Kubrick'},
{ name: '2001', director: 'Kubrick'},
{ name: 'Full Metal Jacket', director: 'Kubrick'},
];
};
// Could add more controllers as named properties of the "controllers" object.
// Finally register controllers with module.
demoApp.controller(controllers);
</script>
</body>
</html>