i have used window.setInterval for solving this issue and it is working well now, and instead of invoking the function inside onInit, now I have moved it into afterViewInit
ngAfterViewInit(): void {
this.startPersistentCountdown();
}
startPersistentCountdown(): void {
this.stopCountdown();
this.zone.runOutsideAngular(() => {
this.countdownTimer = window.setInterval(() => {
this.zone.run(() => {
this.updateAuctionTimers(this.liveAuctions);
this.updateAuctionTimers(this.futureAuctions);
this.groupFutureAuctions();
this.cdr.markForCheck();
});
}, 1000);
});
}