Problems with object ngFor containing objects

2

I'm using it as follows:

<ion-item *ngFor="let via of lines.daysOperations?.week?.tripA?.routes; let i = index" text-wrap (click)="toggleGroup(i+'i')"
                      [ngClass]="{active: isGroupShown(i+'i')}">

E is giving this error:

  

Error: Uncaught (in promise): Error: Can not find a supporting object '[object Object]' of type 'Via Recanto Verde'. NgFor only supports binding to Iterables such as Arrays.   Error: Can not find a supporting object '[object Object]' of type 'Via Recanto Verde'. NgFor only supports binding to Iterables such as Arrays.

My object looks like this:

{ outros itens ..., routes: {name: "lorem inpsum", schedules:{10:00, 11:00, 12:00}}}

How can I resolve this?

I put the elvis ? operator but it did not solve my problem.

    
asked by anonymous 19.07.2017 / 17:12

0 answers