<input formControlName="totalPaymentMethod" mask="00*.00" [(ngModel)]="numberOrStringFormModel" >
@KanKai Hi. Could you provide error message ?
Bad practice using ngModel with formControlName
It's happening to me to:
<input type="text" formControlName="cpf" id="cpfInput" mask="000.000.000-00" matInput>
When I use formControl it works, but when I use formControlName (a form control inside a form group) it throws an error:
ngx-mask inputValue.slice is not a function
Please help me. I really like this lib because it's possible to get the 'unmasked' value.
Updating: The mask works, even though it throws an error after the page is loaded.
First I thought it was because of the matInput but it wasn't. Then I found the cause:
When the value is defined as an object the error occurs:
cpf: [{ value: ''}, [Validators.required]],

But if its a simple value it doesn't cpf: ['', [Validators.required]],
cpf: ['', [Validators.required]],

@kosmicke can you provide more details about you config and about your form, i did not find this problem
@kosmicke Did you solved your issue? I have this same error with a input with 4 mask possibilities, and I'm trying to change the mask after the function loads the data and write inside the input.