Uncaught TypeError: Cannot set property 'length' of null at VirtualScroll.readUpdate

半世苍凉 提交于 2019-12-10 11:08:01

问题


I was using simple ion-list with ngFor to display items in a list in ionic 3 & was working fine. Then I used virtual scroll with ion-list & now I am getting following error:

Uncaught TypeError: Cannot set property 'length' of null at VirtualScroll.readUpdate

Code snippet:

 <ion-list [virtualScroll]="anArray" approxItemHeight="50px">
        <div *virtualItem="let arrayItem">
    //other code

Array declaration: 
    public anArray: any[];

In constructor:
    this.anArray = [];

After network response:
    this.anArray = data.result;

来源:https://stackoverflow.com/questions/45750977/uncaught-typeerror-cannot-set-property-length-of-null-at-virtualscroll-readup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!