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

Using ngIf to filter ion-slides created by ngFor

$
0
0

@uclastudentmedia wrote:

So I'm trying to have a modal filter slides generated by an ngFor. Here's what I have:

<ion-slides loop="true" autoplay="false">
    <ion-slide *ngFor="#category of categories, #i=index">
        <ion-list *ngIf="category.show">
           ...HTML Content
        </ion-list>
    </ion-slide>
</ion-slides>

With AngularJS 1, I'd use ng-if on the same line as the ng-for. However, this doesn't work here; some Googling has revealed this: https://github.com/angular/angular/issues/4792. As such, the best I can do is to put the ngIf on the ion-list beneath the ion-slide, as per the code above. The problem with this, however, is that while the slide content is hidden, the slides are still there (albeit empty). I'd like to only create slides if the category.show property is true. Thanks in advance!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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