Closed FolabiAhn closed 3 years ago
You need limit event.type
is notify
, pls refer to https://github.com/cipchk/ngx-countdown#countdownevent.
Can you please write the code to do it. I follow your example here : https://cipchk.github.io/ngx-countdown/#/
Like this:
import { Component } from "@angular/core";
import { CountdownEvent } from "ngx-countdown";
@Component({
selector: "my-app",
template: `
<countdown
[config]="{ leftTime: 10, format: 'mm:ss', notify: [10, 6] }"
(event)="handleCountdownEvent($event)"
></countdown>
`
})
export class AppComponent {
handleCountdownEvent(event: CountdownEvent): void {
if (event.action === 'notify') {
console.log(event);
}
//console.log("60 sec left");
}
}
Ooh ok thanks, I get it. Notify type is an array of number, I was setting it to a number.
Possible Bug Report
I set a 15mn countdown. I would like to notify when 60 sec left. But the notify is trigger at the start of the application.
I set a stackblitz : https://stackblitz.com/edit/ngx-countdown-setup-twyrr6
Current behavior
Notify is trigger at the start of the application
Expected behavior
Notify when 60 sec left.
Am i missing something ? Thanks