-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08-hello-module.html
More file actions
36 lines (34 loc) · 1.08 KB
/
08-hello-module.html
File metadata and controls
36 lines (34 loc) · 1.08 KB
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
<!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>
// Modules are containers/namespaces for controllers, views, etc.
// Create a module with a given name (for ng-app directive)
// 2nd arg is list of dependencies; may contain names of other modules
// which should be loaded at runtime (sorta like requirejs).
var demoApp = angular.module('demoApp', []);
demoApp.controller('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'},
];
});
</script>
</body>
</html>