Display an ion-item in an ion-list dynamically

618 views Asked by At

I would like to display an ion-list with an ion-item-divider and ion-item. The ion-item is depending on ion-item-divider result.

So, this is my code:

<ion-list *ngFor="let group of groups">
<ion-item-divider>
    {{ group.name }}
</ion-item-divider>
<ion-item ng-repeat="company in loadCompanies(group.id)">
    <ion-avatar item-start>
        <img src="img/avatar.png">
    </ion-avatar>
    <h2>{{ company.name }}</h2>
    <p>Text example...</p>
</ion-item>

The ng-repeat is executing the loadCompanies function indefinitely... Do you have some tips to display the name of the company depending on the group id ..?

0

There are 0 answers