import { timer } from "rxjs";
@Component({
})
export class AppComponent implements OnInit{
progressBar: boolean = true; // Show spinner / progress bar initlly
constructor(){
const source = timer(2000); // 2 milli secs
const subscribe = source .subscribe( hide => this.hideProgress() } );
hideProgress(){
this.progressBar = false; // call the hide spinner
}
}
}
import { interval } from "rxjs";