The following code works fine:
<ion-list [virtualScroll]="photos">
<ion-item *virtualItem="let photo">
<ion-img [src]="photo.path"></ion-img>
</ion-item>
</ion-list>
But when I add approxItemHeight
as follows
<ion-list [virtualScroll]="photos" [approxItemHeight]="80px">
I am getting this error:
browser_adapter.js:84 EXCEPTION: Error: Uncaught (in promise): Template parse errors:
Parser Error: Unexpected token 'px' at column 3 in [80px] in EventAlbumTabComponent@43:43 ("
<ion-list [virtualScroll]="photos" [ERROR ->][approxItemHeight]="80px">
<ion-item *virtualItem="let photo">
"): EventAlbumTabComponent@43:43
Removing the px
as follows
<ion-list [virtualScroll]="photos" [approxItemHeight]="80px">
throws this error
virtual-util.js:481 Uncaught TypeError: approxHeight.indexOf is not a function
calcHeight @ virtual-util.js:481
calcDimensions @ virtual-util.js:456
readDimensions @ virtual-scroll.js:368
(anonymous function) @ virtual-scroll.js:378
Please help.