Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable } from '@angular/core';
- @Injectable()
- export class LoginService {
- constructor() { }
- testUser = {username: 'tester', password: 'password'};
- loggedIn = false;
- isLoggedIn() {
- return this.loggedIn;
- }
- login(username, password) {
- if (username === this.testUser.username && password === this.testUser.password) {
- this.loggedIn = true;
- }
- return this.isLoggedIn();
- }
- }
Add Comment
Please, Sign In to add comment