-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
82 lines (80 loc) · 4.03 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html ng-app="store">
<head>
<title>My Angular App!</title>
<link rel="stylesheet" href="public/css/bootstrap.min.css"/>
<link rel="stylesheet" href="public/css/styles.css"/>
<script src="public/js/angular.min.js"></script>
<script type="text/javascript" src="public/js/app.js"></script>
</head>
<body class="list-group" ng-controller="StoreController as store">
<header>
<h1 class="text-center">Flatlander Crafted Gems</h1>
<h2 class="text-center">- an Angular store -</h2>
</header>
<!-- Store controler and store as alias for usage inside div-->
<div class="list-group-item" ng-repeat="product in store.products | limitTo:3">
<h3 product-title></h3>
<button class="btn btn-success" ng-show="product.canPurchase">Add to cart</button>
<product-gallery></product-gallery>
<section class="tab" ng-init="tab = 1" ng-controller="PanelController as panel">
<ul class="nav nav-pills">
<li ng-class="{active:panel.isSelected(1)}">
<a href ng-click="panel.selectTab(1)">Description</a>
</li>
<li ng-class="{active:panel.isSelected(2)}">
<a hfef ng-click="panel.selectTab(2)">Specifications</a>
</li>
<li ng-class="{active:panel.isSelected(3)}">
<a href ng-click="panel.selectTab(3)">Reviews</a>
</li>
</ul>
<div class="panel" ng-show="panel.isSelected(1)">
<h4>Description</h4>
<p>{{product.description}}</p>
</div>
<div class="panel" ng-show="panel.isSelected(2)">
<h4>Specifications</h4>
<blockquote>None yet</blockquote>
</div>
<div class="panel" ng-show="panel.isSelected(3)">
<h4>Reviews</h4>
<blockquote ng-repeat="review in product.reviews">
<b>Stars: {{review.stars}}</b>
<div>{{review.body}}</div>
<cite class="clearfix">- by: {{review.author}} on {{review.createdOn | date:'HH:mm:ss'}}</cite>
</blockquote>
<form name="reviewForm" ng-controller="ReviewController as reviewCtrl"
ng-submit="reviewForm.$valid && reviewCtrl.addReview(product)" novalidate>
<!-- Live Preview -->
<blockquote ng-show="reviewCtrl.show()">
<strong>{{reviewCtrl.review.stars}} Stars</strong>
{{reviewCtrl.review.body}}
<cite class="clearfix">- {{reviewCtrl.review.author}}</cite>
</blockquote>
<!-- Review Form -->
<h4>Submit a Review</h4>
<fieldset class="form-group">
<select class="form-control" ng-options="stars for stars in [5,4,3,2,1]"
title="Stars" ng-model="reviewCtrl.review.stars" required>
<option value="">Rate the Product</option>
</select>
</fieldset>
<fieldset class="form-group">
<textarea class="form-control" placeholder="Write a short review of the product..."
title="Review" ng-model="reviewCtrl.review.body" required></textarea>
</fieldset>
<fieldset class="form-group">
<input type="email" class="form-control" placeholder="[email protected]" title="Email"
ng-model="reviewCtrl.review.author" required />
</fieldset>
<div>reviewForm is {{reviewForm.$valid}}</div>
<fieldset class="form-group">
<input type="submit" class="btn btn-primary pull-right" value="Submit Review" />
</fieldset>
</form>
</div>
</section>
</div>
</body>
</html>