I'm using Ionic's slides component (based on Swiper) and it works great. However, I have a specific use case where I need to set the slider's spaceBetween option based on an async call.
I tried using the .update() method but without any effect.
public sliderOptions: Slider = {
spaceBetween: 0
}
async ngOnInit() {
await this.getDocuments();
}
async function getDocuments() {
//this.sliderOptions.spaceBetween = -75; (HERE IT WORKS)
let response = await this.service.getDocuments();
this.sliderOptions.spaceBetween = -75; // DOESN'T WORK
this.slides.update().then(() => console.log('SLIDER UPDATED'));
}
<ion-slides #slides [options]="sliderOptions">
....
</ion-slides>
What am I doing wrong?