【发布时间】:2015-08-04 08:57:40
【问题描述】:
我在 angularjs 中使用 jquery ui 日期选择器,它工作正常。但是当 datepicker 进入 ng-repeat 循环时它不起作用。
<input type="text" class="form-control date_picker" ng-model="date.date" ng-repeat="date in ot.dates">
//Directive
app.directive('otForm', function () {
return {
restrict: 'E',
replace: true,
templateUrl: 'app/components/ots/form.html',
link: function ($scope, form) {
$(".date_picker").datepicker({
dateFormat: 'dd-mm-yy',
prevText: '<i class="fa fa-chevron-left"></i>',
nextText: '<i class="fa fa-chevron-right"></i>',
showButtonPanel: false,
changeYear: true,
changeMonth: true
});
}
}
})
我该如何解决这个问题?
【问题讨论】:
-
你能展示你的
ng-repeat循环吗? - 已添加,谢谢 -
它在文本框中
-
究竟是什么不起作用?您是否看到带有日期值的输入?
标签: javascript jquery angularjs datepicker