Ion Switch with ngFor


#1

Hello, I tried to combine switch and ngfor. I’ve tried but it doesn’t allow 2 property in one dom. Is there anyway arround to make it works? This’s the code…

<div [ngSwitch]="page" >
        <ion-grid *ngFor="let data of dataRes" *ngSwitchCase="'{{data.nama}}'">
            
        </ion-grid>
    </div>

Thanks…


#2

If you don’t get any better answers, you might look into using ngIf and ng-container to replace ngSwitch.


#3

Could you give me an example? I still have no Idea about it. Thanks