I have a
ListView of custom components that receive a boolean
@Input() property which is responsible of displaying some parts of the template.
This is the
<ListView [items]="photos"> <ng-template let-item="item"> <app-post [photo]="item" [displayInfo]="display"></app-post> </ng-template> </ListView>
display variable is set to
And this is the
app-post template :
<StackLayout *ngIf="displayInfo" verticalAlignment="center"> .... </StackLayout>
displayInfo is the input property.
app-post component I have logic that changes the
displayInfo value to true.
I noticed however that the
ListView only creates a couple of components and than reuses them as scrolling down.
This causes the following (example) scenario :
- List of 5
app-postcomponents, all with
- Click on 1st
- 3d and 5th
app-postcomponents have already
How can I avoid this behaviour and have all custom components with the property set to the value specified with in the listview?