-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (52 loc) · 1.79 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
<!doctype html>
<html lang="en" ng-app="ShoppingListCheckOff">
<head>
<title>Shopping List Check Off</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<script src="js/angular.min.js" type="text/javascript"></script>
<script src="js/app.js" type="text/javascript"></script>
<style>
.emptyMessage {
font-weight: bold;
color: red;
font-size: 1.2em;
}
li {
margin-bottom: 7px;
font-size: 1.2em;
}
li > button {
margin-left: 6px;
}
button > span {
color: green;
}
</style>
</head>
<body>
<div class="container">
<h1>Shopping List Check Off</h1>
<div class="row">
<!-- To Buy List -->
<div class="col-md-6" ng-controller="ToBuyController as tobuy">
<h2>To Buy:</h2>
<ul>
<li ng-repeat="item in tobuy.items">Buy {{item.quantity}} {{item.name}} <button class="btn btn-default" ng-click="tobuy.buy($index)"><span class="glyphicon glyphicon-ok"></span> Bought</button></li>
<!-- <li>Buy 10 cookies <button class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Bought</button></li> -->
</ul>
<!-- <div class="emptyMessage" ng-if="expression">Everything is bought!</div> -->
<div class="emptyMessage" ng-if="tobuy.message()">Everythings is bought</div>
</div>
<!-- Already Bought List -->
<div class="col-md-6" ng-controller="AlreadyBoughtController as alreadybough">
<h2>Already Bought:</h2>
<ul>
<li ng-repeat="item in alreadybough.items">Bought {{item.quantity}} {{item.name}}</li>
</ul>
<div class="emptyMessage" ng-if="alreadybough.message()">Nothing bought yet.</div>
</div>
</div>
</div>
</body>
</html>