import { Injectable } from '@angular/core' ; @ Injectable ( ) export class Scheduler { public async sleepAsync ( milliseconds ) { return new Promise ( ( resolve ) => setTimeout ( resolve , milliseconds ) ) ; } }