I already search for all community and don't find any solution.
Have a form in angular inside of stepper. The problem is when page is load, the form is validating on start, making the input in red color, like this:
How can i prevent this? I already try with markAsPristine and others, but, nothing...
Here is .TS part when initialize the form (it's call from ngOnInit):
this.professionalDataForm = this.formBuilder.group({
professionalRUT: this.formBuilder.control({value:'', disabled: false},[Validators.required]),
professionalName: this.formBuilder.control({value:'', disabled: false}),
address: this.formBuilder.control({value:'', disabled: false}),
commune: this.formBuilder.control({value:'', disabled: false}),
email: this.formBuilder.control({value:'', disabled: false})
});
And here the .html
<form [formGroup]="professionalDataForm">
<div class="row">
<mat-form-field class="col-md-4" appearance="outline">
<mat-label>Rut del profesional</mat-label>
<input matInput formControlName="professionalRUT" >
<mat-error class="line-broken-tooltip">
adsf
</mat-error>
</mat-form-field>
thnks...