私はAngular2 HTTP(観測可能な)方法を理解に苦労しています:ここでは、なぜ我々は、加入者の方法が必要なのか:Angular2
は私のコードです:
login(username:string,password:string) {
let headers = new Headers();
this.createAuthorizationHeader(headers,username,password);
return this.http
.get(this.url,{headers:headers})
.map(this.extractData)
.catch(this.handleError).subscribe(e => console.log(e));
}
private extractData(res: Response) {
let body = res.json();
console.log(body);
return body.data || { };
}
私の質問です:私たちが加入し必要な理由メソッド、Observableのマップメソッドでデータとそれ以外のものをすべて抽出できる場合は?
ありがとうございました