
committed by
Matias Niemelä

parent
e1fb65cac4
commit
a363be6b5c
@ -20,12 +20,12 @@ export class HeroService {
|
||||
|
||||
getHero(id: number) {
|
||||
return this.http.get(`api/heroes/${id}`)
|
||||
.map(response => response.json().data as Hero);
|
||||
.map(response => response.json() as Hero);
|
||||
}
|
||||
|
||||
getHeroes() {
|
||||
return this.http.get(`api/heroes`)
|
||||
.map(response => response.json().data as Hero[]);
|
||||
.map(response => response.json() as Hero[]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ export class HeroService {
|
||||
|
||||
getHeroes() {
|
||||
return this.http.get('api/heroes')
|
||||
.map((response: Response) => <Hero[]>response.json().data);
|
||||
.map((response: Response) => <Hero[]>response.json());
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
Reference in New Issue
Block a user