Access Object name with angular in Template Node

I have an Object array and would like to use the Object name as the "Group" name in a template but I can not find the correct syntax to the name

This is what the Object array looks like

> {" Control 1":[
> {"id":1,"date":"2020-11-25","Data":90},
> {"id":2,"date":"2020-11-25","Data":800},
> {"id":3,"date":"2020-11-25","Data":350},
> {"id":4,"date":"2020-11-25","Data":-350,}],
> " Control 2":[
>     {"id":5,"date":"2020-11-25","Data":45},
>     {"id":6,"date":"2020-11-25","Data":60}],
> " Control 3":[
>     {"id":7,"date":"2020-11-25","Data":-1},
>     {"id":8,"date":"2020-11-25","Data":-350},
>     {"id":9,"date":"2020-11-25","Data":0.09},
>     {"id":10,"date":"2020-11-25","Data":25}]}

In the template node this is what I have

<h2>System</h2>
<div ng-repeat="obj in msg.payload">
    <h3 >{{obj}}</h3>
    <table><thead>
        <tr>
            <th>ID</th> 
            <th>Date</th>
            <th>Data</th>
        </tr></thead><tbody>

        <tr ng-repeat="device in obj">
            <td>{{ device.id }}</td>
            <td>{{ device.date }}</td>
            <td>{{ device.Data }}</td>
        </tr>
    </tbody></table>
</div>

What I need is at h3 - To show "Control 1" as the value next "Control 2" and so on
How do I access in in {{obj ['the name'] }} ?

Hi .. i dont have to much experience with Angular
a quick internet search suggests using (key, value)

<h2>System</h2>
<div ng-repeat="(key, value) in msg.payload">
    <h3 >{{key}}</h3>
    <table>
        <thead>
        <tr>
            <th>ID</th> 
            <th>Date</th>
            <th>Data</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="device in value">
            <td>{{ device.id }}</td>
            <td>{{ device.date }}</td>
            <td>{{ device.Data }}</td>
        </tr>
    </tbody></table>
</div>
1 Like

Man thank you I missed that search :relieved:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.