diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 6cd7afcdea..79542565e9 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -767,14 +767,11 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi } if (scope.datepickerOptions) { - angular.forEach(scope.datepickerOptions, function(value, option) { - // Ignore this options, will be managed later - if (['minDate', 'maxDate', 'minMode', 'maxMode', 'initDate', 'datepickerMode'].indexOf(option) === -1) { - datepickerEl.attr(cameltoDash(option), value); - } else { - datepickerEl.attr(cameltoDash(option), 'datepickerOptions.' + option); - } - }); + datepickerEl.attr('datepicker-options', 'datepickerOptions'); + + if (angular.isDefined(scope.datepickerOptions.datepickerMode)) { + datepickerEl.attr('datepicker-mode', 'datepickerOptions.datepickerMode'); + } } angular.forEach(['minMode', 'maxMode', 'datepickerMode', 'shortcutPropagation'], function(key) { diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index 84c79cf643..7ec3ccedb3 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -2103,7 +2103,7 @@ describe('datepicker', function() { describe('show-weeks', function() { beforeEach(function() { $rootScope.opts = { - 'show-weeks': false + showWeeks: false }; var wrapElement = $compile('
')($rootScope); $rootScope.$digest(); @@ -2123,7 +2123,7 @@ describe('datepicker', function() { beforeEach(function() { $rootScope.date = null; $rootScope.opts = { - 'initDate': new Date('November 9, 1980') + initDate: new Date('November 9, 1980') }; var wrapElement = $compile('')($rootScope); $rootScope.$digest();