This is not an Angular problem, but rather CORS. By definition, CORS will only return six โsimpleโ headers: Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, and Pragma.
This is why you see the full set when using a REST client such as Postman, but when called from your Angular client, you will see only the set limited to CORS.
To solve this problem, you need to add the Access-Control-Expose-Headers header in the following lines:
let headers = new Headers(); headers.append('Access-Control-Expose-Headers', 'etag'); let options = new RequestOptions({ headers: headers }); return this.http.get(uri, options).map(this.extractData).catch(this.catchError);
Note that you may need to increase the server-side code to support the required open headers.
In my case (C #), I redefined the EnableCors call (inside WebApiConfig) to include โETAGโ in the list of open headers (fourth parameter of the EnableCorsAttribute function).
Steve s
source share