fix(angular): apply touch, dirty and pristine form control classes (#24558)

Resolves #24483
This commit is contained in:
Sean Perkins
2022-01-12 14:48:01 -05:00
committed by GitHub
parent 9a15753fd9
commit 273ae2cc08
4 changed files with 18 additions and 2 deletions

View File

@@ -12,7 +12,8 @@
<ion-item>
<ion-label>DateTime</ion-label>
<ion-datetime formControlName="datetime" min="1994-03-14" max="2017-12-09" display-format="MM/DD/YYYY"></ion-datetime>
<ion-datetime formControlName="datetime" min="1994-03-14" max="2017-12-09" display-format="MM/DD/YYYY">
</ion-datetime>
</ion-item>
<ion-item>
@@ -65,6 +66,7 @@
<p>
Form Submit: <span id="submit">{{submitted}}</span>
</p>
<ion-button id="mark-all-touched-button" (click)="markAllAsTouched()">Mark all as touched</ion-button>
<ion-button id="submit-button" type="submit" [disabled]="!profileForm.valid">Submit</ion-button>
</form>

View File

@@ -46,4 +46,8 @@ export class FormComponent {
});
}
markAllAsTouched() {
this.profileForm.markAllAsTouched();
}
}