2
我在启动主题和Angular 2中的p日历有问题,我想在用户选择日期并设置空白值后清除日历值。 我的代码:在primeng pcalendar中设置空白值
组件
<div style="margin-right: -6px">
<p-calendar [(ngModel)]="viewModel.fromDate" [showIcon]="true" readOnlyInputText="true" (click)="restoreValues()"></p-calendar>
</div>
打字稿文件
export class RequestSearcherComponent implements OnInit {
restoreValues(): void {
this.viewModel.areaIds = [];
this.viewModel.cedingIds = [];
this.viewModel.requestType = [];
this.viewModel.requestResponsible = [];
this.viewModel.requestStatus = [];
this.fromDate.setDate(null);
}
}
我尝试了很多的方法和途径如出现在代码中的setDate
。 但不工作:(
任何人可以帮助我吗?
在此先感谢。