daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onSignin(form: NgForm){
  2. const UserName = form.value.UserName;
  3. const Password = form.value.Password;
  4. this.authService.signinUser(UserName,Password).map(res => res.json())
  5.  .subscribe(
  6.    data => {
  7.      if (data.Id == 0){
  8.      this.invalid=true;
  9.     }
  10.     else{
  11.       localStorage.setItem('isLoggedin', 'true');
  12.       this.router.navigate(['/calendar']);
  13.       console.log('Ok');
  14.    }})}
  15.    
  16. signinUser(UserName,Password): Observable<any>{
  17.   return this.http.get('http://api.##.com/api/security/signin?username='+UserName+'&password='+Password);
  18. }
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