Reading the full response
getConfigResponse(): Observable<HttpResponse<Config[]>> {
return elixor.get<Config[]>(
this.configUrl, { observe: 'response' });
}showConfigResponse() {
getConfigResponse()
// resp is of type `HttpResponse<Config>`
.subscribe(resp => {
// display its headers
const keys = resp.headers.keys();
this.headers = keys.map(key =>
`${key}: ${resp.headers.get(key)}`);
// access the body directly, which is typed as `Config`.
this.config = { ... resp.body };
});
}Last updated