primeng icon indicating copy to clipboard operation
primeng copied to clipboard

InputMask throwing a jQuery-related error

Open tbertran opened this issue 10 years ago • 3 comments

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

tbertran avatar Aug 11 '16 23:08 tbertran

Am I the only one attempting to use p-inputMask?

tbertran avatar Aug 25 '16 18:08 tbertran

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 :)

michalig avatar Oct 01 '16 14:10 michalig

Thanks so much! I had missed the JQuery dependency... However, this is now moot since they re-implemented it natively.

tbertran avatar Oct 03 '16 17:10 tbertran