问题
I am trying to use textMask on ionic 3, but it's not working I am getting error message (Can't bind to 'textMask' since it isn't a known property of 'ion-input') . I am following Joshmorony's tutorial https://www.joshmorony.com/improve-mobile-form-ux-with-input-masks/
Click here to see the error message
app.module.ts
 import { TextMaskModule } from 'angular2-text-mask';
 @NgModule({
  imports: [
    FormsModule,
    TextMaskModule 
 ],
contact.html
        <ion-input type="tel" 
           [(ngModel)]="phoneNumber" 
           [textMask]="{mask: masks.phoneNumber}" >
        </ion-input>
contact.ts
  import { TextMaskModule } from 'angular2-text-mask';
  export class ContactPage {
  form: FormGroup;
  masks: any;
  phoneNumber: any = "";
  constructor() {
    this.masks = {
        phoneNumber: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
    };
 }
}
    回答1:
If you have existing home.module.ts or contact-page.module.ts (based on the image), do the importing of TextMaskModule to them and not in the app.module.ts
来源:https://stackoverflow.com/questions/50729114/ionic3-cant-bind-to-textmask-since-it-isnt-a-known-property-of-ion-input