Closed airda2895 closed 3 years ago
(I'm closing this as I don't need help anymore, thanks!)
Searching for a solution to this problem led me here, but there was no useful solution. So, here is what I did to achieve this done:
After setting a viewchild reference: @ViewChild('timeDisplay') timeDisplay;
implement AfterViewInit
interface, then call stop on the viewchild reference this.timeDisplay.stop();
Hi, I need help with something. I do not want the timer to autostart, I just want it to start after pressing a key (I already have a method for that). I have set the
autostart
property tofalse
, but that hides the timer completely, and I want it shown but set to 00:00:00.I have also tried using the
stop()
method onngOnInit{}
, but I'm getting this error:Property 'ngOnInit' in type 'CountdownComponent' is not assignable to the same property in base type 'OnInit'.
Code:
<p><strong>Time:</strong> <cd-timer #basicTimer format="hms"></cd-timer></p>
How can I achieve this?
Thanks in advance!