I'm having trouble while making a simple call from my NG app to my ASP.NET Core WebAPI. The code is the one following:
this.http.post(actionUrl, credentialsDto)
.map((data: Response) => {
if (data !== null) {
localStorage.setItem(this.tokenStorageKey, JSON.stringify(data));
}
});
I tried to log my "data" callback parameter, but adding a call to console.log() in my if statement results in nothing (means i have no console output at all). Meanwhile if i add a console.log() call before or after the call, but in the same function, they are perfectly executed.
Does anyone know what's happening here? I'm a JS novice, so don't blame me. I'm using the HTTP client native in Angular 5.
Thanks in advance.