I am trying to convert some code from legacy syntax of ionic 6 code to the modern syntax of ionic 7.
I have a case like this that triggers a lot of warnings.
<ion-item>
<ng-container [ngSwitch]="attribute.dataType">
<ion-label [position]="lookupValues ? 'floating' : 'stacked'"
>{{ attribute.type }}
<span *ngIf="type?.unitId as unit"> ({{ unit }})</span>
</ion-label>
<ion-input
*ngSwitchCase="'Integer'"
data-test="attribute-inner"
[formControl]="control"
type="number"
#input
(keydown)="numberFieldValidate($any($event).target.value, $event)"
></ion-input>
<ion-input
*ngSwitchCase="'Decimal'"
data-test="attribute-inner"
[formControl]="control"
type="number"
(keydown)="numberFieldValidate($any($event).target.value, $event)"
></ion-input>
<ion-input
*ngSwitchCase="'Real'"
data-test="attribute-inner"
[formControl]="control"
type="number"
(keydown)="numberFieldValidate($any($event).target.value, $event)"
></ion-input>
<ion-input
*ngSwitchCase="'String'"
[formControl]="control"
type="text"
inputmode="text"
></ion-input>
</ng-container>
</ion-item>
How to rewrite it in modern syntax without repeating the ion-label on every ion-input?
Thank you for attention!