4
import {Http, Response, Headers} from '@angular/http';
getHeroes(): Observable<Heros[]> {
return this.http.get(this.heroesUrl, {withCredentials: true}
)
.map(this.extractData)
.catch(this.handleError);
}
不要得到標題的位置和方式。如何添加Headers到http.get請求在Angular2中?
var myHeaders = new Headers();
myHeaders.append('Access-Control-Allow-Origin', '*')
它們如何組合?