-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontrollers.html
More file actions
45 lines (42 loc) · 1.36 KB
/
Copy pathcontrollers.html
File metadata and controls
45 lines (42 loc) · 1.36 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
37
38
39
40
41
42
43
44
45
<html ng-app="szalekApp">
<head>
<meta charset="utf-8">
<title>Angular.js Example</title>
<script src="angular.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<section ng-controller="NameCtrl">
<h1>{{hello}}</h1>
<ul>
<li ng-repeat="name in names">
{{name}}
<a href="" ng-click="removeName(name)">delete</a>
</li>
</ul>
<form ng-submit="addName()">
<input type="text" ng-model="newName"/>
<input type="submit"/>
</form>
</section>
<section ng-controller="CountryStaticCtrl">
<ul>
<li ng-repeat="country in countries">
Name: {{country.name}} - population {{country.population}}
</li>
</ul>
</section>
<section ng-controller="CountryCtrl">
Search: <input ng-model="query" type="text"/>
<br/>
<a href="" ng-click="orderField ='name'; orderReverse = !orderReverse">by Name</a>
<a href="" ng-click="orderField ='population'; orderReverse = !orderReverse">by Population</a>
<br/>
<ul>
<li ng-repeat="country in countries | filter:query | orderBy:orderField:orderReverse">
Name: {{country.name}} - population {{country.population}}
</li>
</ul>
</section>
</body>
</html>