logbon72 / angular-material-datetimepicker

Datepicker for Angular Material, mimick's Android's date time picker
https://logbon72.github.io/angular-material-datetimepicker
MIT License
169 stars 123 forks source link

1.6.7 not working on Angular 1.5.9 #114

Open ptitdam2001 opened 7 years ago

ptitdam2001 commented 7 years ago

Hi,

My application is on angular 1.5.9 and it is not working, I have that message :

TypeError: Cannot read property 'createChild' of null at Object.link (webpack:///./node_modules/ng-material-datetimepicker/js/angular-material-datetimepicker.js?:160:50) at eval (webpack:///./node_modules/angular/angular.js?:1259:18) at eval (webpack:///./node_modules/angular/angular.js?:10089:44) at invokeLinkFn (webpack:///./node_modules/angular/angular.js?:10095:9) at nodeLinkFn (webpack:///./node_modules/angular/angular.js?:9492:11) at compositeLinkFn (webpack:///./node_modules/angular/angular.js?:8757:13) at nodeLinkFn (webpack:///./node_modules/angular/angular.js?:9486:11) at compositeLinkFn (webpack:///./node_modules/angular/angular.js?:8757:13) at nodeLinkFn (webpack:///./node_modules/angular/angular.js?:9486:11) at compositeLinkFn (webpack:///./node_modules/angular/angular.js?:8757:13) <input mdc-datetime-picker="" date="true" time="true" type="text" format="{{$ctrl.datePickerConfig.format}}" min-date="$ctrl.datePickerConfig.minDate" ng-model="$ctrl.form.validation_at" cancel-text="{{'datepicker.cancel' | translate}}" today-text="{{'datepicker.today' | translate}}" ok-text="{{'datepicker.ok' | translate}}" week-start="$ctrl.datePickerConfig.weekStart" class="ng-pristine ng-untouched ng-valid ng-isolate-scope">

To fix that bug, you should replace at line 160 with below :

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

=> https://github.com/beenote/angular-material-datetimepicker/issues/14

hexadecy commented 7 years ago

Affect only the more advanced fork. Fixed in 1.7.1

ptitdam2001 commented 7 years ago

Good for me! Thanks!