-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock-api.js
68 lines (61 loc) · 1.32 KB
/
mock-api.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
angular.module('MockApiModule',['ngMockE2E'])
.run(function ($httpBackend) {
var products = [{"type" :[
{
"name": "Canny",
"count": 1000
},
{
"name": "Banny",
"count": 3000
},
{
"name": "Danny",
"count": 2000
}
],
"sales":[
{
"salesdate": "04/02/2015",
"amount": 300
},
{
"salesdate": "04/03/2015",
"amount": 400
},
{
"salesdate": "04/9/2015",
"amount": 700
},
{
"salesdate": "04/12/2015",
"amount": 500
},
{
"salesdate": "04/13/2015",
"amount": 300
},
{
"salesdate": "04/15/2015",
"amount": 300
},
{
"salesdate": "04/20/2015",
"amount": 350
},
{
"salesdate": "04/21/2015",
"amount": 560
},
{
"salesdate": "04/26/2015",
"amount": 300
},
{
"salesdate": "04/28/2015",
"amount": 390
}
]
}];
$httpBackend.whenGET('http://5637ccdf1a271a1100252149.mockapi.io/products').respond(products);
})