Closed jeneser closed 7 years ago
So you have the slides inside of a component that is loading tabs as well? I'm a bit confused, could you please provide a plunkr of the issue?
@mhartington Yes!
http://plnkr.co/edit/tO0dkp?p=preview
Related code:
onTabsChange() {
// var slider_index = this.slider.getActiveIndex();
var tab_index = this.tabs.getSelected().index; // <== Error Cannot read property 'index' of null
console.log(tab_index);
this.slider.slideTo(2); // <== Error Cannot read property 'length' of undefined
// if (tab_index != slider_index) {
// this.slider.slideTo(tab_index);
// }
}
There's another question.
tabs.getSelected().index; // <== Error Cannot read property 'index' of null
I created a new issue.
https://github.com/driftyco/ionic/issues/10538
Seems to be something wrong with the Slides internal '_slides' array because even calling length()
on the Slides instance throws the same error.
In the Plunker, comment out:
this.slider.slideTo(2);
and replace it with
console.log('length is:'+this.slider.length());
to see the error too.
Hello all, I am going to close this issue as a duplicate of https://github.com/driftyco/ionic/issues/10830
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x") [ ] 1.x [ x ] 2.x
I'm submitting a ... (check one with "x") [ x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
Expected behavior:
When i used slideTo() in ionViewDidEnter() and onSlideDidChange(), all going well.
But , i write slideTo() into onTabsChange(){}.I got the Runtime Error.
Why?
Steps to reproduce:
Related code:
home.html
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Similar: https://github.com/driftyco/ionic/issues/10499