我正在将日期重复到表中的行,在每一行中,我都有2个输入,这些输入具有用于初始化datepicker的类,尽管我调用了用于初始化datepicker onload的类。使用ng-repeat之外的输入可以正常工作,但是在编辑行时使用ng-repeat内的输入,则不会显示选择器对话框。我不知道问题出在哪里。
这是我的HTML:
<tr ng-repeat="holiday in public_holidays track by $index" class="ng-cloak">
<td class="text-center">
<div class="search-order text-center">
<div ng-class="{literal}{'col-md-6 col-sm-6 col-xs-6' : editMode,'col-md-5 col-sm-5 col-xs-5' : !editMode }{/literal}">
<div class="wrap-input">
<span ng-hide="editMode"><% holiday.from_date %></span>
<div ng-show="editMode">
<input type="text" id="from-date-<% $index %>" ng-model="holiday.from_date" placeholder="Start date" class="input-datepicker">
<img src="{$link_file}/public/images/date.png" width="30" class="icon-date">
</div>
</div>
</div>
<div class="col-md-2 col-sm-2 col-xs-2" ng-hide="editMode">
<span>-</span>
</div>
<div ng-class="{literal}{'col-md-6 col-sm-6 col-xs-6' : editMode,'col-md-5 col-sm-5 col-xs-5' : !editMode }{/literal}">
<div class="wrap-input">
<span ng-hide="editMode"><% holiday.to_date %></span>
<div ng-show="editMode">
<input type="text" id="to-date-<% $index %>" ng-model="holiday.to_date" placeholder="End date" class="input-datepicker">
<img src="{$link_file}/public/images/date.png" width="30" class="icon-date">
</div>
</div>
</div>
</div>
</td></tr>