在编辑表单时,在下面的代码中..我从字段中获取 json 到行变量..它显示“row.create_tour.startDate”和“row.create_tour.endDate”的值..当我在表单开始打印它们时..但是,当我将这些模型分配给pick-a-date时,它会变空..我该怎么办?选择日期是否有任何默认设置?在具有选择日期的输入框中显示值的任何其他选项?
下面是代码片段:
<div ng-repeat="row in fields">
<div layout="row">
<div class="dateField">
<md-input-container>
<label>Start date <span class="requiredStart">*</span> </label>
<input type="text" name="startDate[$index]" class="inputbox required startDate" pick-a-date="startDate[$index]" pick-a-date-options="options" min-date="create_tour.startDate" ng-model="row.create_tour.startDate" ng-change="updateChildEndDate(row);" required/>
<span style="color:red;font-size: 14px;" ng-show="step3Form.startDate[$index].$dirty && step3Form.startDate[$index].$invalid">
<span ng-show="step3Form.startDate[$index].$error.required" >This field is required</span>
</span>
</md-input-container>
</div>
<div class="dateField">
<md-input-container>
<label>End date <span class="requiredStart">*</span></label>
<input type="text" name="endDate[$index]" class="inputbox required endDate" ng-model="row.create_tour.endDate" pick-a-date="endDate[$index]" min-date="row.create_tour.startDate" required/>
<span style="color:red" ng-show="step3Form.endDate[$index].$dirty && step3Form.endDate[$index].$invalid">
<span ng-show="step3Form.endDate[$index].$error.required" >This field is required</span>
</span>
</md-input-container>
</div>
</div>
</div>