Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputMask throwing a jQuery-related error #727

Closed
tbertran opened this issue Aug 11, 2016 · 3 comments
Closed

InputMask throwing a jQuery-related error #727

tbertran opened this issue Aug 11, 2016 · 3 comments

Comments

@tbertran
Copy link

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
Copy link
Author

tbertran commented Aug 25, 2016

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

@michalig
Copy link

michalig commented Oct 1, 2016

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

@tbertran
Copy link
Author

tbertran commented Oct 3, 2016

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

@tbertran tbertran closed this as completed Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants