-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
29 lines (27 loc) · 963 Bytes
/
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
<!DOCTYPE html>
<html ng-app='ShoppingListApp'>
<head>
<meta charset="utf-8">
<script src="angular.min.js"></script>
<script src="app.js"></script>
<link rel="stylesheet" href="styles.css">
<title>Custom Service Through a Provider</title>
</head>
<body>
<h1>Custom Service Through a Provider</h1>
<!-- Preconfigured List -->
<div id="list" ng-controller='ShoppingListController as list'>
<h3>Shopping List</h3>
<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>
<ol>
<li ng-repeat="item in list.items">
{{ item.quantity }} of {{ item.name }}
<button ng-click="list.removeItem($index);">Remove Item</button>
</li>
</ol>
<div class="error">Error: {{list.errorMessage}}</div>
</div>
</body>
</html>