-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
49 lines (40 loc) · 1.29 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html ng-app='ShoppingListDirectiveApp'>
<head>
<meta charset="utf-8">
<script src="jquery-3.1.0.min.js"></script>
<script src="angular.min.js"></script>
<script src="app.js"></script>
<link rel="stylesheet" href="style.css">
<title>Manipulating the DOM with link</title>
</head>
<body>
<h1>Manipulating the DOM with link</h1>
<!-- LIST #1 - unlimited items -->
<div id="list" ng-controller='ShoppingListController as list'>
<div>
<input type="text" ng-model="list.itemName" placeholder="item name">
<input type="text" ng-model="list.itemQuantity" placeholder="quantity">
<button ng-click="list.addItem();">Add Item</button>
<span>{{list.lastRemoved}}</span>
</div>
<shopping-list
id="list1"
items="list.items"
title="{{list.title}}"
on-remove="list.removeItem(index)">
<span class="warning">WARNING! WARNING! {{list.warning}}</span>
</shopping-list>
<shopping-list
id="list2"
items="list.items"
title="{{list.title}}"
on-remove="list.removeItem(index)">
<div>
<div class="title">OH, THE HORROR!</div>
<div>{{list.warning}}</div>
</div>
</shopping-list>
</div>
</body>
</html>