-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
118 lines (70 loc) · 1.14 KB
/
app.js
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
(function(){
var app = angular.module('store', [ ]);
var gems = [
{
name: "Dodecahedron",
price: 2.95,
description: ". . .",
canPurchase: true,
images: [
{
full: 'Photo0001.jpg',
thumb: 'Photo0038.jpg'
},
{
full: 'Photo0038.jpg',
thumb: 'Photo0001.jpg'
}
]
},
{
name: "Pentagonal Gem",
price: 5.95,
description: ". . .",
canPurchase: false,
}
];
app.controller("StoreController", function(){
this.products = [
{
name: 'Awesome Multi-touch Keyboard',
price: 250.00,
description: "...",
images: "...",
reviews: [
{
stars: 5,
body: "I love this product!",
author: "joe@thomas.com",
terms: "-",
color: "-"
},
{
stars: 1,
body: "This product sucks",
author: "tim@hater.com",
terms: "-",
color: "-"
}]
}
];
}
);
app.controller("ReviewController", function(){
this.review = {};
this.addReview = function(product) {
product.reviews.push(this.review);
this.review = {};
};
});
app.controller("PanelController", function(){
this.tab = 1;
this.selectTab = function(setTab) {
this.tab = setTab;
};
this.isSelected = function(checkTab){
return this.tab === checkTab;
};
});
}
)();