-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (34 loc) · 1.06 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
<div ng-app="shop" ng-controller="mainController as mainCtrl" ng-cloak>
{{mainCtrl.cart.cartItems}}
<h1> Online Food Order Cart </h1>
<div class="sections" ng-repeat="section in mainCtrl.sections">
<h3>
{{section.title}}
</h3>
<p ng-if="section.items.length === 0">
No items at the moment.
</p>
<table ng-if="section.items.length > 0">
<thead>
<th></th>
<th>Item</th>
<th>Price</th>
<th>Quantity</th>
</thead>
<tr ng-repeat="item in section.items">
<td><input type="checkbox" ng-model="item.checked" ng-click="mainCtrl.cart.updateItem($event, item)"/></td>
<td>{{item.title}}</td>
<td>{{item.price | currency}}</td>
<td><input type="text" size="4" ng-model="item.quantity" ng-change="mainCtrl.cart.updateTotal(item)"/></td>
</tr>
</table>
</div>
<div>
<b>TOTAL:</b> {{mainCtrl.cart.total | currency}}
<br>
<br>
<button ng-click="mainCtrl.cart.checkout()">
Order Now
</button>
</div>
</div>