【发布时间】:2020-09-21 06:05:13
【问题描述】:
我正在使用 ngx-countdown npm 包在我的网页上显示倒计时。 我想根据来自后端的数据设置leftTime属性,我尝试了以下方式,但它不起作用,
在我的 html 中,
<countdown #cd [config]="notifyConfig" (event)="handleEvent($event)"></countdown>
在我的 component.ts 中
notifyConfig: CountdownConfig = { leftTime: this.consultationDurationInSeconds, notify: [120], format: 'mm:ss', };
this.consultationDurationInSeconds = data.ConsultationDuration.Minutes*60;
我的数据对象有我想绑定到 leftTime 属性的分钟。但是当我尝试这种方式时,它会显示一条错误消息,
** 无法将“无效日期”转换为日期**,
谁能帮我解决这个问题?
【问题讨论】:
标签: typescript countdown angular9