-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (31 loc) · 1.03 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
(function() {
var app = angular.module('gemStore', ['store-directives']);
app.controller('StoreController', ['$http', function($http){
var store = this;
store.products = [];
$http.get('https://raw.githubusercontent.com/ogsmith/Data/master/store-products.json').success(function(data){
store.products = data;
});
}]);
app.controller('secondCollect', ['$http', function($http){
var second = this;
second.data = [];
$http.get('https://raw.githubusercontent.com/ogsmith/Data/master/data2.json').success(function(data){
second.data = data;
});
}]);
app.controller('thirdCollect', ['$http', function($http){
var third = this;
third.data = [];
$http.get('https://raw.githubusercontent.com/ogsmith/Data/master/data3.json').success(function(data){
third.data = data;
});
}]);
app.controller('ReviewController', function() {
this.review = {};
this.addReview = function(product) {
product.reviews.push(this.review);
this.review = {};
};
});
})();