Cześć,
potrzebuje wyjaśnienia. Dlaczego to wyświetla poprawnie zawartość headera:
this.http.post('http://localhost:8080/login', credentials, {responseType: "text", observe: 'response'}).subscribe(res=> console.log(res.headers.get("Authorization").toString()))
a to już nie:
var headerData;
this.http.post('http://localhost:8080/login', credentials, {responseType: "text", observe: 'response'}).subscribe(res=> headerData = res.headers.get("Authorization").toString())
console.log(headerData);
w konsoli mam : undefined
Jestem noob w angularze, chciałem coś na szybko zrobić i nie ogarniam. Ktoś może mnie oświecić? Z góry dzięki.