Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

feat(datepicker): add datepickerOptions support #5340

Closed

Conversation

wesleycho
Copy link
Contributor

  • Add support for options object to concisely configure datepicker

self[key] = angular.isDefined($attrs[key]) ? $interpolate($attrs[key])($scope.$parent) : datepickerConfig[key];
});
if ($attrs.datepickerOptions) {
var datepickerOptions = $scope.$parent.$eval($attrs.datepickerOptions);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a potential flaw with this - if the user breaks the object reference, this will have the old reference cached.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we simply put in on the scope object? Extra watch but fixes that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess I could do datepickerOptions: '='

@wesleycho wesleycho force-pushed the feat/datepicker-options branch from 044dfbe to c0bfb71 Compare January 25, 2016 23:09
@@ -12,6 +12,29 @@ The datepicker has 3 modes:

### uib-datepicker settings

* `datepicker-options`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order please.

- Add support for options object to concisely configure datepicker
@wesleycho wesleycho force-pushed the feat/datepicker-options branch from c0bfb71 to b7e7a14 Compare January 26, 2016 16:11
@wesleycho wesleycho closed this in e58c42c Jan 27, 2016
@wesleycho wesleycho deleted the feat/datepicker-options branch January 27, 2016 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants