Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. var output=this.loginService.IsLogin(Username, Password).subscribe();
  2.  
  3. var output=this.loginService.IsLogin(Username, Password).subscribe();
  4.  
  5. if (output == true) {
  6. this.router.navigate(['/incidentSupport'])
  7. }
  8. else if (userName.trim() == "" && password.trim() == "")
  9. {
  10. this.msg = "Please enter the username or Password"
  11. }
  12. else
  13. {
  14. this.msg = "Invalid username or password"
  15. }
  16.  
  17. fetchList(start: string, end: string): Observable<Object> {
  18. return this.http.get(URL)
  19. }
  20.  
  21. this.loginService.IsLogin(Username, Password).subscribe((resp: any) => {
  22. // This assumes that your API directly returns a boolean
  23. if(output) {
  24. this.router.navigate(['/incidentSupport']);
  25. }
  26. else if(userName.trim() == "" && password.trim() == "") {
  27. this.msg = "Please enter the username or Password"
  28. }
  29. else {
  30. this.msg = "Invalid username or password"
  31. }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement