Skip to content

Commit

Permalink
fix #14 ngModelOptions for Angular 1.5-
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecy committed Jul 24, 2017
1 parent 26b76bd commit 7898779
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/angular-material-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,9 @@ function ngMaterialDatePicker(moment) {
}

if (ngModel) {
ngModel.$options = ngModel.$options.createChild({
'*': '$inherit',
debounce: 500
});
var ngModelOptions = {'*': '$inherit', debounce: 500};
ngModel.$options = ngModel.$options ? ngModel.$options.createChild(ngModelOptions) : ngModelOptions;

ngModel.$formatters.push(function (value) {
if (typeof value === 'undefined') return;
var m = moment(value);
Expand Down

0 comments on commit 7898779

Please sign in to comment.