From 28579b19a48f9ca4a25c916f5ba740d8cdc796ed Mon Sep 17 00:00:00 2001 From: TijsRaes Date: Fri, 16 Jun 2017 10:57:02 +0200 Subject: [PATCH] Update datepicker.directive.js --- src/js/datepicker.directive.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/js/datepicker.directive.js b/src/js/datepicker.directive.js index 032910d..a50de08 100644 --- a/src/js/datepicker.directive.js +++ b/src/js/datepicker.directive.js @@ -15,9 +15,6 @@ return { restrict: 'A', require: 'ngModel', - scope: { - config: '=datepickerConfig' - }, link: function(scope, element, attrs, ngModel) { var template = angular.element($templateCache.get('datepicker.html')); @@ -33,7 +30,7 @@ }; // Apply and init options - scope.config = angular.extend(defaultConfig, scope.config); + scope.config = angular.extend(defaultConfig, angular.fromJson(attrs.datepickerConfig)); if (angular.isDefined(scope.config.minDate)) moment.utc(scope.config.minDate).subtract(1, 'day'); if (angular.isDefined(scope.config.maxDate)) moment.utc(scope.config.maxDate).add(1, 'day');