Hi guys, I have a form that’s built with FormBuilder:
<form [formGroup]="myProfileForm">
<ion-input formControlName="first_name" placeholder="First Name"></ion-input>
<div *ngIf="!myProfileForm.controls.first_name.valid">
Error!
</div>
</form>
The problem I’m having is that when I delete my pre-filled first_name
input, myProfile.controls.first_name.value
is still the original value Jourdan
. Thus, my first name is still valid and the error message doesn’t show. Anyone know what the issue is? I’m on the latest ionic beta 11 version if that helps.
Here’s my Typescript:
this.myProfileForm = fb.group({
first_name: ['Jourdan', Validators.required]
});
Thanks!