Skip to content

Commit 20ff2f9

Browse files
author
wg102
committed
fix: angular mat-form-fiel error
1 parent 7ad65c2 commit 20ff2f9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

frontend/src/app/resource-form/volume/volume.component.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
<!-- Volume Name Input -->
1111
<mat-form-field appearance="outline" id="name">
1212
<mat-label>Name</mat-label>
13-
<input matInput formControlName="name" *ngIf="volume.value.type == 'New'" />
14-
<mat-select formControlName="name" *ngIf="volume.value.type == 'Existing'">
15-
<mat-option *ngFor="let pvc of existingPVCs" [value]="pvc">{{ pvc }}</mat-option>
16-
</mat-select>
13+
<input
14+
matInput
15+
formControlName="name"
16+
*ngIf="volume.value.type == 'New'; else existingPvcControl"
17+
/>
18+
<ng-template #existingPvcControl>
19+
<mat-select formControlName="name">
20+
<mat-option *ngFor="let pvc of existingPVCs" [value]="pvc">{{
21+
pvc
22+
}}</mat-option>
23+
</mat-select>
24+
</ng-template>
1725
</mat-form-field>
1826

1927
<!-- Size Input -->

0 commit comments

Comments
 (0)