import { Injectable } from '@angular/core' ; import { Observable , of } from 'rxjs' ; import { delay } from 'rxjs/operators' ; @ Injectable ( { providedIn : 'root' } ) export class AuthService { accessToken = ( ) => `${ new Date ( ) . getTime ( ) }` ; getAccessToken ( ) { return `${ new Date ( ) . getTime ( ) }` ; } getToken ( ) { return of ( `${ new Date ( ) . getTime ( ) }` ) . pipe ( delay ( 400 ) ) ; } async getTokenAsPromise ( ) { return `${ new Date ( ) . getTime ( ) }` ; } }