question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ionic slides shows first image only

See original GitHub issue

Hello,

Having similar issue to https://github.com/tjoskar/ng-lazyload-image/issues/256

However, since it is a closed issue, I have created a new open one.

However, when i tried to use the same fix. I am getting a runtime error on ionic 3

page.ts - here im getting a debug notice on Subject not found. TS.

imageChange$ = new Subject();

  slideChanged() {
    this.imageChange$.next();
  }

page.html

<ion-slides *ngIf="(item | async).image1" class="image-slider" loop="true" slidesPerView="2" (ionSlideDidChange)="slideChanged()">
        <ion-slide *ngIf="(item | async).image1">
          <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image1" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
        </ion-slide>
        <ion-slide *ngIf="(item | async).image2">
            <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image2" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
          </ion-slide>
          <ion-slide *ngIf="(item | async).image3">
              <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image3" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
            </ion-slide>
            <ion-slide *ngIf="(item | async).image4">
                <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image4" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
              </ion-slide>
              <ion-slide *ngIf="(item | async).image5">
                  <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image5" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
                </ion-slide>
                <ion-slide *ngIf="(item | async).image6">
                    <img [defaultImage]="'https://www.placecage.com/1000/1000'" [lazyLoad]="(item | async).image6" class="thumb-img" imageViewer [scrollObservable]="imageChange$" [offset]="'100'">
                  </ion-slide>
      </ion-slides>
    </ion-card>

Uncaught (in promise): ReferenceError: Subject is not defined ReferenceError: Subject is not defined

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
sabiridwancommented, Apr 25, 2018

Hi @tjoskar thanks… i worked when i use <ion-slide #swiper> <img [defaultImage]=“defaultImage” [lazyLoad]=“image” [scrollObservable]=“swiper.ionSlideWillChange” /> </ion-slide>

0reactions
tjoskarcommented, Apr 24, 2018

Hi @sabiridwan, Do you get the same error, ReferenceError: Subject is not defined ReferenceError: Subject is not defined? In any case, please open a new issue and I will try to help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Removing Ionic slider pager when only one slide
Try something like this: <ion-slides #imageSlides [pager]=“imageSlides.length() > 1”>. pager is an attribute that is boolean.
Read more >
Ion slides weird behaviour - Ionic Forum
Hi, when i use a ion slides in my project at the very beginnig it shows only one of the slides ... As...
Read more >
Building a slideshow with Ionic Slides API - Mastering Ionic
Dynamically generate a slideshow from an array of data where each slide displays a specific image and accompanying caption; Use breakpoints ...
Read more >
Ionic 5 - 06 Ion-Slides - YouTube
The Slides component is a multi-section container. Each section can be swiped or dragged between. It contains any number of Slide components ...
Read more >
How to Lazy Load Images with Ionic - YouTube
Learn to lazy load images within your Ionic apps with a cool and powerful package that we can customise with hooks exactly for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found