Created
September 11, 2016 19:15
-
-
Save gkatsanos/a69947ad9acb1eb3f1152ab428e0284a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public getDetailedInfo(card): Observable<Card> { | |
return this.http.get(`${this.privateUrl}${card.name}`) | |
.map(this.extractData) | |
.publishReplay(1) | |
.refCount(); | |
} | |
private extractData(res: Response) { | |
let body = res.json(); | |
return new Card(body.data.name, body.data.card_type, body.data.text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment