# Access Object name with angular in Template Node

**URL:** <https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607>\
**Category:** Dashboard\
**Created:** [27 November 2020 05:01 UTC](https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607 "2020-11-27T05:01:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulf007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paulf007/32/26758_2.png) [@Paulf007](https://discourse.nodered.org/u/Paulf007)\
**Post date:** [27 November 2020 05:01 UTC](https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607/1 "2020-11-27T05:01:04Z")

</div>

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

```auto
> {" 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

```auto
<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'] }} ?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [27 November 2020 05:56 UTC](https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607/2 "2020-11-27T05:56:59Z")

</div>

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

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![Paulf007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paulf007/32/26758_2.png) [@Paulf007](https://discourse.nodered.org/u/Paulf007)\
**Post date:** [27 November 2020 06:26 UTC](https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607/3 "2020-11-27T06:26:24Z")

</div>

> [@UnborN](#):
>
> a quick internet search suggests using `(key, value)`

Man thank you I missed that search 😌

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 December 2020 06:26 UTC](https://discourse.nodered.org/t/access-object-name-with-angular-in-template-node/36607/4 "2020-12-11T06:26:25Z")

</div>

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