79384255

Date: 2025-01-24 12:01:11
Score: 0.5
Natty:
Report link

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);
    });  
  }

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Sachin Kizhakkepurath