Some of the Angular UI Bootstrap directives, such as datepicker, have configuration instructions like this: "All settings can be provided as attributes in the <datepicker>
or globally configured through the datepickerConfig
."
Although the configuration options are listed, there is no description of what a *Config
is and how I globally configure one. It sounds like this is a standard part of Angular. Is it? How do I use this configuration pattern, and where is it documented?
The three types of directives in Angular are attribute directives, structural directives, and components.
You can not use two structural directives on the same element. You need to wrap your element in another one. It's advised to use ng-container since it wont be rendered in DOM.
Something like this:
angular.module('myModule', ['ui.bootstrap'])
.config(['uibDatepickerConfig', function(uibDatepickerConfig) {
uibDatepickerConfig.showWeeks = false;
}]);
The reference documentation for using config
is in the Angular.Module type under the config method. However, that documentation doesn't tell you how config works. For an overview, look in the Developer Guide under Provider Recipe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With