Hello
I'm looking for a way to display a json object as a collapsible element with the ui-template node.
I found this module which pretty much does what I need. But I couldn't figure out how to integrate it into my node-red installation.
From what I have read here it should be possible to use Angular directives.
In my case this would be <ngx-json-viewer [json]=msg.payload"></ngx-json-viewer>
on the ui-template node.
Here's an example flow
[{"id":"8dd8bc61e88d5baf","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"fdfefd17c0f73572","type":"function","z":"8dd8bc61e88d5baf","name":"Build Payload","func":"msg.payload = {\n \"simple key\": \"simple value\",\n \"numbers\": 1234567,\n \"simple list\": [\n \"value1\",\n 22222,\n \"value3\"\n ],\n \"owner\": null,\n \"simple obect\": {\n \"simple key\": \"simple value\",\n \"numbers\": 1234567,\n \"simple list\": [\n \"value1\",\n 22222,\n \"value3\"\n ],\n \"simple obect\": {\n \"key1\": \"value1\",\n \"key2\": 22222,\n \"key3\": \"value3\"\n }\n }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":340,"wires":[["0568bb5360e44817","e913af9c7c5846b2","571eded6ab367c57"]]},{"id":"4f077dcfb4553f9f","type":"inject","z":"8dd8bc61e88d5baf","name":"Start Manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":340,"wires":[["fdfefd17c0f73572"]]},{"id":"0568bb5360e44817","type":"debug","z":"8dd8bc61e88d5baf","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":260,"wires":[]},{"id":"e913af9c7c5846b2","type":"ui_template","z":"8dd8bc61e88d5baf","group":"648f4862f830ba65","name":"ng-bind-html","order":1,"width":12,"height":3,"format":"<h1>ng-bind-html</h1>\n<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":670,"y":340,"wires":[[]]},{"id":"571eded6ab367c57","type":"ui_template","z":"8dd8bc61e88d5baf","group":"648f4862f830ba65","name":"ngx-json-viewer","order":2,"width":12,"height":3,"format":"<h1>ngx-json-viewer<h1>\n<ngx-json-viewer [json]=\"msg.payload\"></ngx-json-viewer>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":680,"y":420,"wires":[[]]},{"id":"648f4862f830ba65","type":"ui_group","name":"Group 1","tab":"12dd3a4e3e2dc806","order":1,"disp":true,"width":12},{"id":"12dd3a4e3e2dc806","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]
I installed the additional module with npm install ngx-json-viewer
but the ui-template node is not showing any content. What I expect to see on this example is this:
Can anyone help with this?
Thanks!