create() should return Hero model. (#3414)
This commit is contained in:
parent
a083fdbe8b
commit
d65f1943e3
|
@ -61,7 +61,7 @@ export class HeroService {
|
|||
return this.http
|
||||
.post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers})
|
||||
.toPromise()
|
||||
.then(res => res.json().data)
|
||||
.then(res => res.json().data as Hero)
|
||||
.catch(this.handleError);
|
||||
}
|
||||
// #enddocregion create
|
||||
|
|
Loading…
Reference in New Issue