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

Ion-slide for loop not working

$
0
0

@OmDIonic wrote:

Hi
I am trying to load data in ion-slide using for loop but it not appear.

.html

<ion-content>
        <ion-slides pager="true" [options]="slideOpts" loop="true">
                <ion-slide *ngFor="let item of news1" >
                        <div>
                                <ion-label>item.title</ion-label>
                        </div>
                </ion-slide>
        </ion-slides>
</ion-content>

.ts

 slideOpts = {
    initialSlide: 0,
    speed:10,
    direction:"vertical",
  };

When trying with below code it works fine`

<ion-content>
        <ion-slides pager="true" [options]="slideOpts" >
                <ion-slide >
                        <div>
                                <ion-label>label1</ion-label>
                        </div>
                </ion-slide>
<ion-slide >
                        <div>
                                <ion-label>label2</ion-label>
                        </div>
                </ion-slide>
<ion-slide >
                        <div>
                                <ion-label>label3</ion-label>
                        </div>
                </ion-slide>
        </ion-slides>
</ion-content>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70795

Trending Articles



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