的特性「數據」是否可以發佈到URL app/heroes/1/jobs
角2在內存中的Web API - 無法讀取空
當我嘗試,我得到了錯誤Cannot read property 'data' of null
createJob(hero: Hero, job: Job): Observable<Job> {
const url = `${this.heroUrl}/${hero.id}/jobs`;
return this.http.post(url, JSON.stringify(job), {headers: this.headers})
.map(res => res.json().data)
.catch(this.handleError);
}
感謝您的解釋 – locnguyen