onSubmit(): void {
if (this.RegisterForm.valid) {
this.http.post(‘http://localhost:5000/register-post’, this.RegisterForm.value).subscribe(
(response: any) => {
this.user.push(response);
// Redirection ou autre action après le succès de l’inscription
},
(error) => {
console.log(‘Error:’, error);
// Afficher un message d’erreur à l’utilisateur
}
);
} else {
// Afficher un message d’erreur indiquant que le formulaire est invalide
console.log(‘Formulaire invalide’);
}
}
i try to register using my api and angular but it’s not working
christ CP90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.