Dear Experts Angular, Please See The Code Below And Tell Me Is It Correct or Wrong ?
onFormSubmit() {
this.isLoadingResults = true;
this.authService.login(this.loginForm.value).subscribe(data => {
this.isLoadingResults = false;
this.router.navigate(['/secure'],{ replaceUrl: true }).then(_ => console.log('You are secure now!'));
}, (err: any) => {
console.log(err);
this.isLoadingResults = false;
});
}
Top comments (0)