Cannot read property 'minutesGap' of undefinedSee original GitHub issue
I’m having the following issue after upgrading to
Angular 9 and
v5.4.0 of ngx-material-timepicker.
core.js:3866 ERROR TypeError: Cannot read property 'minutesGap' of undefined at TimepickerDirective.set [as value] (ngx-material-timepicker.js:1350) at Object.ngOnChangesSetInput [as setInput] (core.js:19023) at setInputsForProperty (core.js:8846) at elementPropertyInternal (core.js:7933) at Module.ɵɵproperty (core.js:14184) at DatetimePickerRangeComponent_Template (datetime-picker-range.component.html:51) at executeTemplate (core.js:7562) at refreshView (core.js:7439) at refreshComponent (core.js:8569) at refreshChildComponents (core.js:7242) at refreshView (core.js:7485) at refreshDynamicEmbeddedViews (core.js:8505) at refreshView (core.js:7459) at refreshDynamicEmbeddedViews (core.js:8505) at refreshView (core.js:7459) at refreshComponent (core.js:8569)
Timepicker is used as follow.
<input matInput placeholder="start time" aria-label="start time" [ngxTimepicker]="startTime" [format]="24" [value]="startTimeValue" /> <ngx-material-timepicker-toggle class="svg-color" [for]="startTime" ></ngx-material-timepicker-toggle> <ngx-material-timepicker #startTime [defaultTime]="startTimeValue" [minutesGap]="5" (timeSet)="onChangeHourStartTime($event)" ></ngx-material-timepicker>
[minutesGap] is defined on
<ngx-material-timepicker>. Am I missing something ?
- Created 3 years ago
- Comments:19 (6 by maintainers)
Top GitHub Comments
Try to bind
[ngxTimepicker]. It seems that order is matter.
Thank you very much, it worked here. I put the value directly on the form and it worked. Thanks again for everyone’s help.