|
@@ -21,31 +21,18 @@ export class FlashCardsProvider {
|
21
|
21
|
httpCl: HttpClient;
|
22
|
22
|
public _robotOverlords: any[] = [];
|
23
|
23
|
constructor(public http: HttpClient) {
|
24
|
|
- console.log('Hello FlashCardsProvider Provider');
|
|
24
|
+ console.log('FlashCardsProvider Provider');
|
25
|
25
|
this.httpCl = http;
|
26
|
26
|
this.getData();
|
27
|
27
|
}
|
28
|
28
|
getData() {
|
29
|
29
|
return this.httpCl.get('assets/data/javacards.txt').subscribe(data => {
|
30
|
|
- // var stringifiedData = JSON.stringify(data);
|
31
|
|
- // //var parsedData: any[] = JSON.parse(stringifiedData);
|
32
|
|
- // this.defaultCards = JSON.parse(stringifiedData);
|
33
|
30
|
for (var key in data) {
|
34
|
31
|
this.defaultCards.push(data[key]);
|
35
|
32
|
}
|
36
|
33
|
});
|
37
|
34
|
}
|
38
|
35
|
|
39
|
|
-
|
40
|
|
- // load() {
|
41
|
|
- // console.log('load json called');
|
42
|
|
- // return new Promise(resolve => {
|
43
|
|
- // this.http.get('assets/data/javacards.json').map(response => {
|
44
|
|
- // this.data = response.json();
|
45
|
|
- // resolve(this.data);
|
46
|
|
- // });
|
47
|
|
- // });
|
48
|
|
- // }
|
49
|
36
|
cardFor(cardindex) {
|
50
|
37
|
this.idx = cardindex % this.defaultCards.length;
|
51
|
38
|
return this.defaultCards[this.idx];
|
|
@@ -66,15 +53,15 @@ export class FlashCardsProvider {
|
66
|
53
|
},
|
67
|
54
|
{
|
68
|
55
|
front: "Card2",
|
69
|
|
- back: "Asshole!"
|
|
56
|
+ back: "Wow!"
|
70
|
57
|
},
|
71
|
58
|
{
|
72
|
59
|
front: "Card3",
|
73
|
|
- back: "Asshole!"
|
|
60
|
+ back: "Nothing!"
|
74
|
61
|
},
|
75
|
62
|
{
|
76
|
63
|
front: "Card4",
|
77
|
|
- back: "Asshole!"
|
|
64
|
+ back: "Never Mind!"
|
78
|
65
|
},
|
79
|
66
|
{
|
80
|
67
|
front: "Card5",
|