如何在ngx-countdown中将数据动态绑定到leftTime

问题描述

我正在使用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属性的分钟。但是当我尝试这种方式时,它会显示一条错误消息,

**无法将“无效日期”转换为日期**,

有人可以帮助我解决这个问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)