Hello. I encountered a problem, please tell me how to solve:
- home.html:
<ion-content #myContent>
<ion-item *ngFor = let some of _somes>
.... some code ....
</ion-item>
</ion-content>
- home.ts
@ViewChild ('myContent') content: Content;
..... some code .....
getSomes() {
this.http.post (....).subscribe((data: any) => {
this._somes = data.somes
}, (error: any) => {}, () => {
this.content.scrollToBottom()
})
}
The problem is the following:
- On demand, the post loads an array of 94+ objects, which has about 15 properties of type String; After processing the data, I believe that
ngZone
changes are detected, but scrolling does not work.
More precisely, it works, but it stops at half the height of ion-content
, apparently at the time the scrollToBottom function is called, the whole array does not succeed in pushing through ngZone.
Question: When, where and how do I call content.scrollToBotoom()
to really get to the end of the content? (Is there an event / method that works after the end of detection of changes in ngZone?)