Issue
I'm trying to redirect to another page after user sign up in ionic angular but i'm getting nothing code below:
this.http.post('http://127.0.1.1:3001/api/signup',user)
.subscribe({
next: (res) => {if(res == "OK"){this.router.navigateByUrl("/otp")}},
error: error => console.error(error),
complete: () => this.router.navigateByUrl("/otp")
});
Solution
you could do something like
.subscribe((res) => {
if (res == "OK") {
this.router.navigate(['otp']);
} else {
this.errmsgshow = true;
this.errmsg = res.msg;
}
Answered By - Ian Ducao
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.