I am trying to add the ‘Required’ property to an ion-input wrapped in an ion-item within a form. I have looked at the Ionic 5 docs and tried the following:
<form #f="ngForm" (ngSubmit)="onSubmit(f)"> <ion-item> <ion-label position = "floating">Investigation Name: </ion-label> <ion-input autofocus = true autocorrect = "on" required clear-input = true [(ngModel)]="data.investigation" name="investigation"></ion-input> </ion-item>
But when I submit the form the input field can be left blank.
I have also tried setting the required property in the form tag but same result.
Thanks in advance