Is this the wrong way to do it? I’ve also tested on device iPhone 6 plus and works fine.
Now I get this on xcode: Message from debugger: Terminated due to memory issue
Can this be a problem because I assign to much data to the jokes array? or is it because of <ion-slides #Slides (ionSlideDidChange)="slideChanged(Slides)">
I just tested using 100 items per request, and it crashed, so I assume that I need to keep the paging as small as possible.
Let’s go back to your original issue. You can’t use something if you don’t import it, the error message was telling you there was nothing named slides. If you’re new to jabascript / typescript modules you wouldn’t know that though, and the line is missing in the docs. Your .then blocks are all on one line and hard to read, and I can’t see your services or all your html idk for sure what your issue is regarding the memory error, but I had no such issues.
I just threw together a real simple demo and it worked just fine in the simulator:
home.ts
import { Component, ViewChild } from '@angular/core';
import { NavController, Slides } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild(Slides) slides: Slides;
jokes = [];
constructor(public navCtrl: NavController) {
for (let i = 0; i <= 100; i++) {
this.jokes.push({
header: `Slide ${i}`,
image: 'https://ionicframework.com/docs/v2/demos/src/slides/slide1.jpeg'
})
}
}
slideChanged() {
let currentIndex = this.slides.getActiveIndex();
console.log("Current index is", currentIndex);
}
}
Hello, could you please take look at this plunker, it looks like ion-slides fails to trigger the ionSlideDidChange() event the moment I switch to another tab. I would like the slide show to continue playing while I browse to other tabs in the application. I consider this to be a bug, unless I missing something.
I looked at it but I don’t quite understand it. I’m not sure why you would expect the slideshow to keep playing once you navigate away. Once you leave a page it’s not going to continue doing anything.
I switch tabs with navcontroller .select(), thus I don’t push/pop navigation in hope to keep players tab alive.
I would like to be able to keep my slides playback playing while I browse other media. Also because I have sound, a postpause, etc… associated with a slide playback, and my current logic is based on this event everything stops (audio, etc…).
I could see the argument about ion-slides not being visible, which would mean I would have to make my own events and restore the correct slide when the tab’s particular player content becomes visible.
However, I find that awkward, especially that other players will continue playing like I am using npm package plyr to play videos in the same tab.
I have not tried to use directly slider.js to see if this is an ionic2 implementation-introduced new behavior.