From 152408007832cbe64460be09e2b83539820143c5 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Thu, 17 Dec 2015 23:18:37 -0500 Subject: [PATCH] fix(datepicker): correctly set minMode/maxMode - Correctly set `minMode` and `maxMode` for the datepicker popup Closes #5093 Fixes #5090 --- src/datepicker/datepicker.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 425aac09c2..f88c1a2f4c 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -642,7 +642,16 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi }); } - angular.forEach(['minMode', 'maxMode', 'minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) { + angular.forEach(['minMode', 'maxMode'], function(key) { + if (attrs[key]) { + scope.$parent.$watch(function() { return attrs[key]; }, function(value) { + scope.watchData[key] = value; + }); + datepickerEl.attr(cameltoDash(key), 'watchData.' + key); + } + }); + + angular.forEach(['minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) { if (attrs[key]) { var getAttribute = $parse(attrs[key]); scope.$parent.$watch(getAttribute, function(value) {