I want to implement input mask in my angular 7 project. I need to know the steps to be followed.
I am trying to use this plugin.
I following the following steps.
Step 1: npm install inputmask --save
Step 2: Imported in my app rounting as import Inputmask from "inputmask";
And in declaration declarations: [Inputmask ]
Step 3: In my component.html
<input data-inputmask="'mask': '[9-]AAA-999'" im-insert="true">
I am getting following issues:
Uncaught Error: Unexpected value 'Inputmask' imported by the module 'AppRoutingModule'. Please add a @NgModule annotation.
How can fix it? Or can i get example code or link.
import Inputmask from "inputmask"is only used to import an ES module, not an Angular module. The imported ES module cannot be declared as a angular component/directive. Importing the ES module gives you access to the Inputmask for use in your typescript code, but it doesn't connect it to the angular template.