InputMask throwing a jQuery-related error
TypeError: jQuery(...).inputmask is not a function
at InputMask.ngAfterViewInit (inputmask.js:63)
at DebugAppView._View_UserComponent0.detectChangesInternal (UserComponent.template.js:1959)
at DebugAppView.AppView.detectChanges (view.ts:255)
at DebugAppView.detectChanges (view.ts:372)
at DebugAppView.AppView.detectViewChildrenChanges (view.ts:283)
at DebugAppView._View_HeaderComponent0.detectChangesInternal (HeaderComponent.template.js:1118)
at DebugAppView.AppView.detectChanges (view.ts:255)
at DebugAppView.detectChanges (view.ts:372)
at DebugAppView.AppView.detectViewChildrenChanges (view.ts:283)
at DebugAppView._View_AppComponent0.detectChangesInternal (AppComponent.template.js:194)
This line in inputmask.ts is causing it:
jQuery(this.el.nativeElement.children[0])['inputmask'](cfg);
I'm not sure what the associative array (on a jQuery object!) is trying to achieve here but I'd love an explanation.
Thanks for the help.
related to #510
Am I the only one attempting to use p-inputMask?
Try to add:
to package.json:
"dependencies": { "jquery.inputmask": "3.3.3" ...
to angular-cli.json:
"scripts": [ "../node_modules/primeui/primeui-ng-all.min.js", "../node_modules/jquery.inputmask/dist/jquery.inputmask.bundle.js" ],
Hope it helps :)
Thanks so much! I had missed the JQuery dependency... However, this is now moot since they re-implemented it natively.