-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (57 loc) · 2.3 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
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>Wine Store</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="angularjs-1.7.0.js"></script>
<script src="main.js"></script>
</head>
<body>
<div ng-app="myBasket" ng-controller="basketController">
<h1>Wine Store</h1>
<div id="basket">
<h3 class="basketTitle">Basket</h3>
<table>
<thead>
<tr>
<th>Id</th>
<th>Quantity</th>
<th>Name</th>
<th>Price</th>
<th>Amount</th>
<th>Actions</th>
</tr>
</thead>
<body>
<tr ng-repeat="item in basket">
<span>{{$index + 1}}</span>
<td row="{{$index}}">{{item.newItem.id}}</td>
<td>
<input type="number" ng-model="item.quantity" />
</td>
<td>{{item.newItem.name}}</td>
<td>{{item.newItem.price}} €</td>
<td>{{item.quantity * item.newItem.price}} €</td>
<td><input class="buttons" type="button" value="Remove" ng-click="removeProduct($index)"/></td>
</tr>
<tr><td colspan=4>Total basket</td><td ng-style="style()"><b>{{total()}} €</b></td><td><button class="buttons">Checkout</button></td></tr>
</body>
</table>
</div>
<div id="container">
<h3 class="productsTitle">Products</h3>
<div class="item" ng-repeat="product in products">
<p>Id: {{product.id}}
<br/><br/>
Name:</p>
<h3>{{product.name}}</h3>
<img class="widthImage" ng-src="{{product.image}}" />
<p class="productsDescription"><strong>Description:</strong><br/>{{product.description}}</p>
<h2>Price: {{product.price}} €</h2>
<input class="buttons" type="button" value="Add" ng-click="addProduct(product)" />
</div>
</div>
</div>
</body>
</html>