You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
V4.0.0-beta.13 - VirtualScroll doesn't call ngOnInit of all its children #16023
@JumBay I misunderstood the problem, I think this is the expected behaviour. Virtual-scroll creates a set of components then it reuses, is it not that the point of a virtual-scroll?
Your component should be stateless if you want to use it with virtual-scroll, only depending in the inputs the component has.
As @manucorporat says - the components will be reused. So ngOnInit will not be called (the component already exist). Virtual scroll only create components who are necessary to fill the viewport.
So you have to look for the changes of this component
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.
Activity
paulstelzer commentedon Dec 7, 2018
Thanks for your issue! Could you please check if this is still an issue in
beta.17? That would be very nice :)JumBay commentedon Dec 7, 2018
Same issue on
beta.17fix(angular): virtual-scroll
fix(angular): virtual-scroll (ionic-team#16729)
JumBay commentedon Dec 17, 2018
I still facing this issue on
beta.19manucorporat commentedon Dec 17, 2018
@JumBay the fix was merged but not released :)
1 remaining item
manucorporat commentedon Dec 17, 2018
@JumBay I misunderstood the problem, I think this is the expected behaviour. Virtual-scroll creates a set of components then it reuses, is it not that the point of a virtual-scroll?
Your component should be stateless if you want to use it with virtual-scroll, only depending in the inputs the component has.
paulstelzer commentedon Dec 17, 2018
As @manucorporat says - the components will be reused. So
ngOnInitwill not be called (the component already exist). Virtual scroll only create components who are necessary to fill the viewport.So you have to look for the changes of this component
And then you will see it :) I also need some time to understand it. So keep in mind: Components are REUSED!
JumBay commentedon Dec 17, 2018
Thanks that's what I thought and I updated my code in this direction.
ionitron-bot commentedon Jan 16, 2019
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.