Ngx-mask: Ionic 4

Created on 6 Mar 2019  路  6Comments  路  Source: JsDaddy/ngx-mask

Can i use this ngx-mask with ionic 4 & Angular 7 ?
Thanks

Most helpful comment

Please share the solution.
So we can use instead of this.

All 6 comments

@blondie63 yes

any example for that?

I have the solution for working in IONIC 4and Angular 7
use <input> instead of <ion-input>
And make input with SCSS look like ion-input.

Use NgxMaskModule.forRoot(),
page.module.ts (page is the page name where you want to use the mask).

@mihirp1730

use \

That's not a solution.

Please share the solution.
So we can use instead of this.

Please share the solution.
So we can use instead of this.

On app.module:

imports:[
  ...
  NgxMaskModule.forRoot()
  ...
]

On yourcomponent.module:

imports:[
  ...
  NgxMaskModule.forChild()
  ...
]

And finally to use on your html:

<ion-input (ngModelChange)="user.cpf=$event" [ngModel]="user.cpf | mask: '000.000.000-99'"></ion-input>
<span>Typed: {{user.cpf | mask: '000.000.000-99'}}<span>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mnagaev picture mnagaev  路  3Comments

humpedli picture humpedli  路  3Comments

salazarr-js picture salazarr-js  路  3Comments

ghost picture ghost  路  3Comments

TimWarp picture TimWarp  路  4Comments