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

do you know how to change the mask through code? #14

Open
raphaelluiz128 opened this issue Jul 10, 2018 · 1 comment
Open

do you know how to change the mask through code? #14

raphaelluiz128 opened this issue Jul 10, 2018 · 1 comment

Comments

@raphaelluiz128
Copy link

i have the html code:
<ion-input type="text" style = 'width:80%' [(ngModel)]="user.cpf_cnpj" mask="999.999.999-99">

and ts code

Change_Toggle(bval:any) {
if (bval===false)
{
this.Type = "Pessoa Jurídica";
this.CPF_CNPJ = "CNPJ";
this.user.type_user = "Pessoa Jurídica";
this.user.cpf_cnpj['mask']="00.000.000/0000-00";
}
else
{
this.Type = "Pessoa Física";
this.CPF_CNPJ = "CPF";
this.user.type_user = "Pessoa Física";
this.user.cpf_cnpj['mask']="999.999.999-99";
}

how do I change the input mask?

@danilopolani
Copy link

Try with [mask]="yourVariable"

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