primeng
primeng copied to clipboard
InputMask does not display initial value with Reactive Forms
If initial value is provided via reactive form, it is not displayed.
My bad, it works.
For me it doesn't seem to work. Initials values only work for normal <input>-Elements and not for <p-inputMask>-Elements:
component.html
<input pInputText [formControl]="myForm.controls['title']" type="text"/> <!-- foo -->
<p-inputMask [formControl]="myForm.controls['title']" mask="***"></p-inputMask> <!-- is empty -->
component.ts
myForm: FormGroup;
ngOnInit() {
this.myForm = this.fb.group({
title: ['foo']
});
}
Same here. As soon as I remove the mask, it works. Any updates on this?
Same here. As soon as I remove the mask, it works. Any updates on this?
Same here:
Template:
<p-inputMask mask="9999.999.999" id="belgianTaxNumber" formControlName="taxNumber" placeholder="9999.999.999"></p-inputMask><!-- 466981655 -->
<input id="taxNumberInput" type="text" pInputText formControlName="taxNumber"><!-- Empty: just seeing placeholder: 9999.999.999 -->
Component:
this.customerForm = this.fb.group({
taxNumber: [this.customer.taxNumber],