daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. login() :void {
  2.     if (this.loginForm.valid){
  3.      this.userSrvc.login(this.loginForm.value).subscribe(
  4.        res =>{
  5.         console.log("success");
  6.      },
  7.      error => {
  8.         console.log("login failed");
  9.       }
  10.     });
  11.   }
  12.  }
  13.    
  14. constructor(private http: HttpClient) {
  15.     this.url = AppConstants.API_ENDPOINT;
  16.     this.headers = new HttpHeaders({ 'Content-Type': 'application/json; charset=utf-8' });
  17.   }
  18.  
  19.   login(params: any): Observable<User> {
  20.     console.log("service called");
  21.     const body = JSON.stringify({ UserName: params.userid, Password: params.password });
  22.     console.log("body", body);
  23.     return this.http.post<User>(this.url + 'Login', body, { headers: this.headers });
  24.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top