Template Help displaying objects in a list

I need a little help with Templates. I have a msg.on topic that has an array of objects with a single field called friendlyName. I want to iterate through these objects and display the friendly names. Here is my code. I do not get details displayed

<table>
    <tr ng-repeat="obj in msg.on">
        
        <td> <md-button ng-click="send({Baction:'OFF',topic:obj.friendlyName})"> OFF </md-button> {{obj.friendlyName}}
            
        </td>
    </tr>
    
</table>

here is a debug output of the array with a single object
image

The template also adds an OFF button that I can click to send an appropriate command

This is working - just set the tab/group for the template

[{"id":"216f7aa7229e3549","type":"ui_template","z":"73a94477.15d104","group":"","name":"","order":6,"width":"5","height":"5","format":"<table>\n    <tr ng-repeat=\"obj in msg.on\">\n\n        <td>\n            <md-button ng-click=\"send({Baction:'OFF',topic:obj.friendlyName})\"> OFF </md-button> {{obj.friendlyName}}\n\n        </td>\n    </tr>\n\n</table>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":1460,"y":940,"wires":[["d5bf2306e5d0819b"]]},{"id":"b390ec0ba236080f","type":"inject","z":"73a94477.15d104","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1180,"y":940,"wires":[["a6c081065c18a063"]]},{"id":"a6c081065c18a063","type":"function","z":"73a94477.15d104","name":"","func":"msg.on = [{ \"friendlyName\": \"mudroom\" }, { \"friendlyName\": \"test\" }]\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1320,"y":940,"wires":[["216f7aa7229e3549"]]},{"id":"d5bf2306e5d0819b","type":"debug","z":"73a94477.15d104","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1610,"y":940,"wires":[]}]

Thanks. That worked great.

No problem, can you mark as solution please ?

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