I have a list of items to display in a template.
<div scrollY="true" height="100px">
<ion-list>
<ion-item *ngFor=`let item of ${currentPage}` >
<ion-label class="ion-text-wrap">
{{item.name}}
<br>
<ion-text>
</ion-text>
</ion-label>
<ion-button fill="solid" id="single-restaurant" (click)="goToNextPage()">
<ion-icon name="arrow-forward-circle-outline">
</ion-icon>
</ion-button>
</ion-item>
</ion-list>
My question is simple, yet i did not find an answer after looking for several hours.
In the ngFor directive, is it possible to use an Input()
to set the array to iterate, depending on the page?
For example, in HomePage
i would have an array named home
so i would set currentPage="home"
and expect to iterate over it.
Is it possible or do i must create a list per page?
Thanks in advance.