How to exclude getter only properties from type in typescript

While readonly does not directly affect whether types are assignable, it does affect whether they are identical. To test whether two types are identical, we can abuse either (1) the assignability rule for conditional types, which requires that the types after extends be identical, or (2) the inference process for intersection types, which throws out … Read more

Angular 4.3.3 HttpClient : How get value from the header of a response?

You can observe the full response instead of the content only. To do so, you have to pass observe: response into the options parameter of the function call. http .get<MyJsonData>(‘/data.json’, {observe: ‘response’}) .subscribe(resp => { // Here, resp is of type HttpResponse<MyJsonData>. // You can inspect its headers: console.log(resp.headers.get(‘X-Custom-Header’)); // And access the body directly, … Read more