Last active
May 21, 2018 21:42
Revisions
-
cgmartin revised this gist
Dec 14, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ * refreshing the datepicker view (and rerunning invalid dates function) * upon an event trigger: `$scope.$broadcast('refreshDatepickers');` * * Works with inline and popup. Include this after `ui.bootstrap` js */ angular.module('ui.bootstrap.datepicker') .config(function($provide) { -
cgmartin revised this gist
Dec 14, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ /** * Decorates the ui-bootstrap datepicker directive's controller to allow * refreshing the datepicker view (and rerunning invalid dates function) * upon an event trigger: `$scope.$broadcast('refreshDatepickers');` * * (Works with inline and popup) */ @@ -19,8 +19,8 @@ angular.module('ui.bootstrap.datepicker') var ngModelCtrl = ctrls[1]; if (ngModelCtrl) { // Listen for 'refreshDatepickers' event... scope.$on('refreshDatepickers', function refreshView() { datepickerCtrl.refreshView(); }); } -
cgmartin created this gist
Dec 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ /** * Decorates the ui-bootstrap datepicker directive's controller to allow * refreshing the datepicker view (and rerunning invalid dates function) * upon an event trigger: `$scope.$broadcast('refreshDates');` * * (Works with inline and popup) */ angular.module('ui.bootstrap.datepicker') .config(function($provide) { $provide.decorator('datepickerDirective', function($delegate) { var directive = $delegate[0]; var link = directive.link; directive.compile = function() { return function(scope, element, attrs, ctrls) { link.apply(this, arguments); var datepickerCtrl = ctrls[0]; var ngModelCtrl = ctrls[1]; if (ngModelCtrl) { // Listen for 'refreshDates' event... scope.$on('refreshDates', function refreshView() { datepickerCtrl.refreshView(); }); } } }; return $delegate; }); });