Answers for "angular subscribe catch stat"

0

angular subscribe catch stat

signIn(user: Login) {
    //console.log("the path = "+this.loginPath);
    return this.http
      .post<any>(this.loginPath, user)
      .subscribe((res: any) => {
        localStorage.setItem('accessToken', res.accessToken);
        console.log(res);
        this._authenticated= true;
        this.router.navigate(['board']);

      },(error: any) => {
        console.log(error);
        if(error.status ==401){
          alert("Login or Password not exist");
        }
      },
        () => {
        console.log("Finally clause");
      }
      );
  }
Posted by: Guest on April-03-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language