他们不会被弃用属性“UIB-日期选择器,弹出”警告是关系到节“日期选择器设置”中列出的datepicker docs所有属性。您必须通过属性“datepicker-options”来提供这些值。 不知道为什么,但“弹出设置”部分中的内容不会引发警告。
在我来说,我有
JS
$scope.datepicker.format = 'shortDate';
$scope.datepicker.options = {
formatYear: 'yy',
startingDay: 1
};
HTML
<input type="text" class="form-control"
ng-model="ngModel"
uib-datepicker-popup="{{ datepicker.format }}"
datepicker-options="datepicker.options"
datepicker-append-to-body="true"
is-open="datepicker.opened"
show-button-bar="false"
close-text="Close"
min-date="minDate"
max-date="maxDate"
custom-class="getCustomClass"
show-weeks="false"
/>
,并成为
JS
$scope.datepicker.format = 'shortDate';
$scope.datepicker.options = {
formatYear: 'yy',
startingDay: 1,
minDate: minDate,
maxDate: maxDate,
showWeeks: false,
customClass: getCustomClass
};
HTML
<input type="text" class="form-control"
ng-model="ngModel"
uib-datepicker-popup="{{ datepicker.format }}"
datepicker-options="datepicker.options"
datepicker-append-to-body="true"
is-open="datepicker.opened"
show-button-bar="false"
close-text="Close"
/>
更新
plunker reproduction
感谢我没有提醒此文档。然而它说:'更改:日期选择器弹出uib-datepicker-popup.'。但'uib-datepicker-popup'正是会贬值的东西...... – mickro