HttpHeaders is in '@angular/common/http' too:
public GetFoo():Observable<Array<Foo>> {
let token:string = this.activeDirectoryContract.GetAccessToken();
let header = new HttpHeaders().set('Authorization', 'Bearer ' + token);
return this.httpClient.get<Array<Foo>>(environment.apiUrl + "foo",
{ headers: header });
}
No comments:
Post a Comment