I want to check if the status code=400 in angular so I can fetch a notif
I've tried this -
signUp() { let body = { login: this.username, nom: this.nom, prenom: this.prenom, adress: this.adress, email: this.email, password: this.password, date_naissance: this.datenaissance, num_tel: this.numTel, } this.signappService.newsignup(body).subscribe( (res: any) => { console.log(res) this.sucess = true; this.failed = false; }, (err) => { console.warn(err) if (err.status == 400) { this.failed = true; this.sucess = false; } }); }
https://stackoverflow.com/questions/67030148/how-can-i-fetech-the-status-code-400-in-angular April 10, 2021 at 09:59AM
没有评论:
发表评论