Guest User

Untitled

a guest
Jan 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import { Injectable } from '@angular/core';
  2.  
  3. @Injectable()
  4. export class LoginService {
  5.  
  6. constructor() { }
  7.  
  8. testUser = {username: 'tester', password: 'password'};
  9. loggedIn = false;
  10.  
  11. isLoggedIn() {
  12. return this.loggedIn;
  13. }
  14.  
  15. login(username, password) {
  16. if (username === this.testUser.username && password === this.testUser.password) {
  17. this.loggedIn = true;
  18. }
  19. return this.isLoggedIn();
  20. }
  21. }
Add Comment
Please, Sign In to add comment