【发布时间】:2016-01-28 04:12:04
【问题描述】:
我的应用程序中的日期选择器工作正常,但我无法直接更改年份。我必须逐月更改年份
日期选择器指令
app.directive('adatepicker', function() {
return {
require: 'ngModel',
link: function(scope, el, attr, ngModel) {
$(el).datepicker({
onSelect: function(dateText) {
scope.$apply(function() {
ngModel.$setViewValue(dateText);
});
}
});
}
};
});
在 HTML 页面中
<input type="text" adatepicker="" ng-model="Date"/>
日期选择器截图
【问题讨论】:
标签: angularjs