点击添加按钮,我得到了一组数据。 我在那里有日期字段,并且它要花多少次才能得到相同的日期,所以有没有办法对“同一日期”字段进行验证,以使它不使用相同的日期。
HTML:
<div>
<p class="normal pull-left m-0">Outcome</p>
<div class="no-padd pull-right text-right">
<button
class="text-right pull-right add_effective"
(click)="addScheduleDetails()">
<i id="add" class="fa fa-plus"></i>
</button>
</div>
</div>
<div formArrayName="ScheduledParent">
<table class="table table-bordered m-t10">
<thead>
<tr>
<th>Timing</th>
</tr>
</thead>
<tbody
*ngFor="let itemrow of emrCarePlanDetailsForm.get('ScheduledParent').controls;let i = index;"
[formGroupName]="i">
<tr>
<td>
<p-calendar
[monthNavigator]="true"
[yearNavigator]="true"
yearRange="1910:2020"
showButtonBar="true"
dateFormat="mm-dd-yy"
placeholder="mm-dd-yyyy"
[showIcon]="true"
[minDate]="minSDate"
formControlName="ScheduledTiming"
class="pull-left">
</p-calendar>
</td>
</tr>
</tbody>
</table>
</div>
TS:
public get scheduleDetails(): FormArray {
return <FormArray > this.emrCarePlanDetailsForm.controls['ScheduledParent'];
}
addScheduleDetails(): void {
this.scheduleDetails.push(this.createscheduleInformation());
}
deleteScheduleDetails(i) {
this.scheduleDetails.removeAt(i);
}
private createscheduleInformation() {
return this.FB.group({
ScheduledTiming: [''],
});
}