ERROR TypeError: Cannot read property 'apply' of undefined
at MaterializeDirective.webpackJsonp.../../../../angular2-materialize/dist/materialize-directive.js.MaterializeDirective.performElementUpdates (materialize-directive.js:190)
at MaterializeDirective.webpackJsonp.../../../../angular2-materialize/dist/materialize-directive.js.MaterializeDirective.ngAfterViewInit (materialize-directive.js:76)
at callProviderLifecycles (core.es5.js:11202)
at callElementProvidersLifecycles (core.es5.js:11177)
at callLifecycleHooksChildrenFirst (core.es5.js:11161)
at checkAndUpdateView (core.es5.js:12271)
at callViewAction (core.es5.js:12631)
at execEmbeddedViewsAction (core.es5.js:12589)
at checkAndUpdateView (core.es5.js:12264)
at callViewAction (core.es5.js:12631)
Here's the compiled JS just in case it might be helpful (since the apply is what's causing the issue apparently):
if (this.isTimePicker()) {
var /** @type {?} */ nativeElement_4 = this._el.nativeElement;
var /** @type {?} */ jqueryPickerElement_2 = $(nativeElement_4);
var /** @type {?} */ timePicker = jqueryPickerElement_2[this._functionName].apply(jqueryPickerElement_2, this._params);
var /** @type {?} */ picker_2 = timePicker.pickatime('picker');
setTimeout(function () {
if (_this.ngModel) {
picker_2.val(_this.ngModel);
}
else {
picker_2.val(jqueryPickerElement_2.val());
}
jqueryPickerElement_2.on('change', function (e) { return nativeElement_4.dispatchEvent(((CustomEvent("input")))); });
});
}
Any chance someone can quickly spot a mistake I'm making? If not, any suggestions on how to fix it? I'm no expert, but I'd be happy to put together a PR if this is indeed a problem.
Absolutely love this project and wish I were proficient enough to identify this issue on my own. I'm hoping it's user error.
Just upgraded to 15.1.9 from 6.x and was going to (happily) switch to
angular2-matrialize
's date/time pickers frommd2-datepicker
.The datepicker worked like a charm but I'm having trouble with the time picker.
Here's what I'm working with:
I'm consistently getting this error though:
If it's any help, here's the line where the problem occurs: https://github.com/InfomediaLtd/angular2-materialize/blob/88aa68f38ded712d6dc1e04a142bcfe20c79f244/src/materialize-directive.ts#L190
Here's the compiled JS just in case it might be helpful (since the
apply
is what's causing the issue apparently):Any chance someone can quickly spot a mistake I'm making? If not, any suggestions on how to fix it? I'm no expert, but I'd be happy to put together a PR if this is indeed a problem.