I am working on a dashboard and am trying to display a certain piece of data. In my scope I have a project which consists of a couple fields and an array of users. The users consist of the following fields:
- user_id
- user_name
- user_email
- role
I want to display the user_name of the role which matches a certain value. Is there a way to do this within my html file or is it recommended to do this in my controller?
My table code looks as follows:
<tbody md-body>
<tr md-row md-select="project" md-select-id="name" md-auto-select
ng-repeat="project in projects.data | orderBy : myOrder">
<td md-cell ng-click="getProject()">{{project.title}}</td>
<td md-cell><i class="material-icons" style="color: green">radio_button_checked</i></td>
<td md-cell>{{project.phase}}</td>
<td md-cell>{{project.budget_indication}}</td>
<td md-cell>{{project.users}}</td> <!-- Display user with specific role -->
<td md-cell>{{project.start_date | date:dd/MM/yyyy}}</td>
</tr>
</tbody>
Thanks in advance!