1
votes

I used this mask in my app from here:

( https://www.npmjs.com/package/ionic-input-mask ),

followed the instructions ofcourse, installed it and imported it in the app module, yet it shows me the error that it's not a known element.

ERROR MESSAGE:

'input-mask' is not a known element:

  1. If 'input-mask' is an Angular component, then verify that it is part of this module.
  2. If 'input-mask' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.Angular
//in the module

import { InputMaskModule } from 'ionic-input-mask';



imports: [
    InputMaskModule,
]
1
This seems like a bad idea to try to use this, its for Ionic 2 and while it says its also for "versions above" it doesn't seem like it is Ionic 4 aware. It's was abandoned 2 years ago, and the github repo has even been deleted. - rtpHarry

1 Answers

1
votes

This seems like a bad idea to try to use this.

Its for Ionic 2 and while it says its also for "versions above" it doesn't seem like it is Ionic 4 aware.

It was abandoned 2 years ago, and the github repo has even been deleted.

This looks like the same type of thing and is new:

https://www.npmjs.com/package/ionic4-mask-directive

As for the actual problem you're experiencing, it might be just that what you were trying isnt compatible or it might have been that you haven't added it to the page module. Ionic 4 has lazy loading and wraps everything up in modules now so its not like just adding it to the main module any more. Another reason to try out the ionic4 mask which should hopefully have modern setup instructions :)