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.
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.
That sounds good, just be sure that your [dataSource] contains only the scenario array and not the object you posted
<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?
What does onlyScenarios look like?
@MathewBerg
That looks like a subset. Is onlyScenarios an array? Can you update the question with some mock data?
@MathewBerg onlyScenarios is an array and also scenarios is array
That image still only shows just a snippet of onlyScenarios, if it’s also an array it should have more data.
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’ ?
Is the component you are using is made for that kind of behavior? Can you post the documentation of the component?
Here is an example of what your are looking for:
Thanks! I will take a look