import { Injectable } from '@angular/core' ; import { IUser } from './user' ; @ Injectable ( ) export class AuthService { currentUser : IUser | null ; redirectUrl : string ; constructor ( ) { } isLoggedIn ( ) { return ! ! this . currentUser ; } login ( userName , password ) { this . currentUser = { id : 2 , userName : userName , isAdmin : false } ; } logout ( ) { this . currentUser = null ; } }