angularjs – 如何全局配置Angular UI引导指令
发布时间:2020-12-17 17:53:53 所属栏目:安全 来源:网络整理
导读:如何在全球范围内使用uibDatepickerConfig配置 bootstrap datepicker?文档只是说明如下: All settings can be provided as attributes in the uib-datepicker or globally configured through the uibDatepickerConfig . 在source code中,它们被定义为常量
如何在全球范围内使用uibDatepickerConfig配置
bootstrap datepicker?文档只是说明如下:
在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'; }]); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |