如果我单击其他压延机,我需要一次显示一个压延机,并希望关闭其他压延机。
我用过压延机。
HTML:
<div class="col-sm-3">
<label class="show"> Date</label>
<p-calendar [monthNavigator]="true" [yearNavigator]="true" yearRange="1910:2020" showButtonBar="true" dateFormat="mm-dd-yy" placeholder="mm-dd-yyyy"></p-calendar>
</div>
<div class="col-sm-3">
<label>Last Occurance</label>
<p-calendar [monthNavigator]="true" [yearNavigator]="true" yearRange="1910:2020" showButtonBar="true" dateFormat="mm-dd-yy" placeholder="mm-dd-yyyy"></p-calendar>
</div>
答案 0 :(得分:1)
对多个压延机采用不同的ngModel
HTML:
<div class="col-sm-3">
<label class="show"> Date</label>
<p-calendar id="date1" [(ngModel)]="date1" [monthNavigator]="true" [yearNavigator]="true" yearRange="1910:2020" showButtonBar="true" dateFormat="mm-dd-yy" placeholder="mm-dd-yyyy"></p-calendar>
</div>
<div class="col-sm-3">
<label>Last Occurance</label>
<p-calendar id="date2" [(ngModel)]="date1" [monthNavigator]="true" [yearNavigator]="true" yearRange="1910:2020" showButtonBar="true" dateFormat="mm-dd-yy" placeholder="mm-dd-yyyy"></p-calendar>
</div>
在ts中:
export class CalendarDemo {
date1: Date;
date2: Date;
}