-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
84 lines (80 loc) · 2.26 KB
/
app.js
File metadata and controls
84 lines (80 loc) · 2.26 KB
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
83
84
(function() {
var app = angular.module('store', []);
app.controller('StoreController', function() {
this.products = gems;
})
app.controller('PanelController', function() {
this.tab = 1;
this.selectTab = function(setTab) {
this.tab = setTab;
};
this.isSelected = function(checkTab) {
return this.tab === checkTab;
}
})
app.controller('ReviewController', function() {
this.review = {};
this.addReview = function(product) {
product.reviews.push(this.review);
this.review = {};
}
})
app.directive("productTitle", function() {
return{
restrict: 'E',
templateUrl: "product-title.html"
};
});
var gems = [{
name: 'Azurite',
shine: 8,
price: 110.50,
rarity: 7,
color: '#0000FFC',
faces: 14,
description: "Some gems have hidden qualities beyond their luster, beyond their shine... Azurite is one of those gems.",
canPurchase: true,
soldOut: false,
image: "images/pentag.jpeg",
reviews: [{
stars: 5,
body: "This product Rocks",
author: "greg@lover.com"
}, {
stars: 1,
body: "This product Sucks",
author: "Alex@hater.com"
}, {
stars: 3,
body: "This product is ok.",
author: "george@neutral.com"
}]
}, {
name: "Zircon",
shine: 70,
price: 1100,
rarity: 2,
color: '#FFA500',
faces: 6,
description: "Zircon is our most coveted and sought after gem. You will pay much to be the proud owner of this gorgeous and high shine gem.",
canPurchase: true,
soldOut: false,
image: "images/do.jpeg",
reviews: [{
stars: 5,
body: "This product Rocks",
author: "JIm@lover.com"
}, {
stars: 1,
body: "This product Sucks",
author: "OWL@hater.com"
}, {
stars: 3,
body: "This product is ok.",
author: "NERDLE@neutral.com"
}]
}]
})();
function QuarterController($scope) {
$scope.Star = 'S3';
}