When the sent data is bad, it gets from the server tables with validator errors, as you can see in the picture. My question is how to get to this array so that you do not have to refer to each element individually on reasonably err.error.erros.email or err.error.erros.password. I would like to display these errors using sweetalert, one below the other.
My code:
this.http.post('https://mylocalhost/api/1.3/user/login', params, {headers: config})
.subscribe(res => {
this.userData = res;
swal('App', 'Zostałeś zalogowany pomyślnie', 'success');
localStorage.setItem('x-ticket', this.userData['x-ticket']);
},
(err: HttpErrorResponse) => {
console.log(err);
});
