I have a challenge where I need to hide forms in a list if they are empty. These forms contain string values. I attempted to use *ngIf but unfortunately, it did not work as expected and empty fields are still visible in the list. How can I address this issue? (In the image provided, ISRawMaterialInspection and ISRawMaterialRiskState are the empty ones.)
Below is the HTML code snippet:
<input matInput class="mt-20" formControlName="IsOxidizable" *ngIf="form.get('IsOxidizable').value"/>
<input matInput class="mt-20" formControlName="ISRawMaterialInspection" *ngIf="!!form.get('ISRawMaterialInspection').value"/>
<input matInput class="mt-20" formControlName="ISRawMaterialRiskState" *ngIf="form.get('ISRawMaterialRiskState').value"/>
And here is the TypeScript code block:
IsOxidizable: new FormControl({
value: this.data.IsOxidizable,
disabled: true,
}),
ISRawMaterialRiskState: new FormControl({
value: this.data.ISRawMaterialRiskState,
disabled: true,
}),
ISRawMaterialInspection: new FormControl({
value: this.data.ISRawMaterialInspection,
disabled: true