Solution 1 :

If scenarios is also an array then to access it to you have to make sure you access that entry:

{{row.scenarios[0].workingPlace}}

Something like this.

Solution 2 :

That sounds good, just be sure that your [dataSource] contains only the scenario array and not the object you posted

Problem :

 <wrapper-table [dataSource]="onlyScenarios"
                 [columns]="columns"
    <ng-container matColumnDef="workingPlaces">
        <th mat-header-cell
            *matHeaderCellDef
            scope="col">{{ 'MENU' | translate }}</th>
        <td mat-cell
            *matCellDef="let row">
            {{row.workingPlace}}
        </td>
    </ng-container>

I have this template and my datasource (onlyScenarios) is an array that contains another array (scenarios). As you can see in the mat-cell, i display the content of that object ({{row.workingPlace}}) but i need to display from the second array(scenarios). I mean something like

{{row.scenarios.workingPlace}}

The ‘onlyScenarios’ looks like this:
https://imgur.com/a/oMzbzEH

How can i do that?

Comments

Comment posted by Mathew Berg

What does onlyScenarios look like?

Comment posted by imgur.com/a/VQhN8nP

@MathewBerg

Comment posted by Mathew Berg

That looks like a subset. Is onlyScenarios an array? Can you update the question with some mock data?

Comment posted by Andrei Mihai

@MathewBerg onlyScenarios is an array and also scenarios is array

Comment posted by Mathew Berg

That image still only shows just a snippet of onlyScenarios, if it’s also an array it should have more data.

Comment posted by Andrei Mihai

i already pass the onlyScenarios from another array as input. ”[onlyScenarios]=”day.dayRoomScenario”. Is there a way to send from here as ‘day.dayRoomScenario.scenario’ ?

Comment posted by ragnar

Is the component you are using is made for that kind of behavior? Can you post the documentation of the component?

Comment posted by link

Here is an example of what your are looking for:

Comment posted by Andrei Mihai

Thanks! I will take a look

By