0
在編輯表格時 在下面的代碼中..我從字段獲取json到行變量.. 它顯示值爲「row.create_tour .startDate「&」row.create_tour.endDate「..當我在表單的開始處打印它們時.. 但是,當我將這些模型分配給選擇日期時,它將變爲空白。我應該爲此做些什麼? 是否有挑選日期的默認設置?任何其他選項來顯示輸入框中的值有選擇日期?選擇日期datepicker設置值在編輯時在angularjs中爲空
下面的代碼片段:
<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>