【发布时间】:2019-11-19 01:01:04
【问题描述】:
我正在尝试重置primeng datepick 日历但不工作。我正在使用angular 8。我已经使用primeng 创建了自定义日期选择器组件。我在下面给出了我的代码。如何重置它?任何人都可以有想法吗?请帮助找到解决办法。
app.component.html:
<p-calendar dateformat="mm/dd/yyyy" [numberofmonths]="4" selectionmode="range" formControlName="datePick"></p-calendar>
<button (click)="resetdate()">Reset Date</button>
app.component.ts:
@ViewChild('p-calendar') calendar: any;
resetdate(){
this.calendar.value = null;
}
【问题讨论】: