gpt4 book ai didi

angularjs - 如何全局配置 Angular UI 引导指令

转载 作者:行者123 更新时间:2023-12-03 00:16:15 25 4
gpt4 key购买 nike

如何配置bootstrap datepicker全局使用 uibDatepickerConfig ?该文档仅说明以下内容:

All settings can be provided as attributes in the uib-datepicker or globally configured through the uibDatepickerConfig.

source code ,它们被定义为常量:

.constant('uibDatepickerConfig', {
formatDay: 'dd',
formatMonth: 'MMMM',
formatYear: 'yyyy',
formatDayHeader: 'EEE',
formatDayTitle: 'MMMM yyyy',
formatMonthTitle: 'yyyy',
datepickerMode: 'day',
minMode: 'day',
maxMode: 'year',
showWeeks: true,
startingDay: 0,
yearRange: 20,
minDate: null,
maxDate: null,
shortcutPropagation: false
})
<小时/>

完全相同的问题已在 this post 中讨论过但该解决方案似乎过时

最佳答案

//where app is the module that depends on 'ui.bootstrap'
// probably your main app module

//for DatePicker options
app.config(['uibDatepickerConfig', function (uibDatepickerConfig) {
uibDatepickerConfig.showWeeks = false;
}]);

//for DatePickerPopup options
app.config(['uibDatepickerPopupConfig', function (uibDatepickerPopupConfig) {
uibDatepickerPopupConfig.closeText= 'Close';
uibDatepickerPopupConfig.placement = 'auto bottom';
}]);

关于angularjs - 如何全局配置 Angular UI 引导指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33497362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com