Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

ngIf inside a ngFor

$
0
0

@TheLLspectre wrote:

Hello everyone !
Let me explain you quickly i have this:

<ion-col *ngFor='let item of firstrow' width-25>
  <page-rasp class="center"></page-rasp>
</ion-col>

And now i have more than one component, and inside the TypeScript file i implement a factory pattern to call the great component, so i want to use ngIf to make something like:

<ion-col *ngFor='let item of firstrow' width-25>
        <div *ngIf='factory == 0'>
          <page-rasp class="center"></page-rasp>
        </div>
        <div *ngIf='factory == 1'>
          <page-rasp2 class="center"></page-rasp2>
        </div>
      </ion-col>

factory is the integer i use to make my pattern factory!

Have you some idea or advice ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>