(2017-08-12, 12:34 AM)JD1 Wrote: I have been able to experiment a bit with this but am running into more problems which are probably general concept issues.
The template node has an input and an output. I can use the template node to put 'stuff' into the assigned group. This 'stuff' could be a coloured data value and presumably a description which would imitate a text node. Up until now I put the template node prior to a text node in the flow but if I understand things right the template node actually replaces the text node? If that is so, why is there an output to the template node - what is it used for ?
Last but not least, the text node has a 'value format' field that allows for angular and HTML expressions - is it possible to cram the entire HTML code given here as an example into that little field and have the value portion of the text node displayed in colour ?
I have never used angularjs before. The whole dashboard is built in it and its not very pleasant to debug the javascript and html. Besides that imho the dashboard is poorly documented. All i know is javascript, css and html and that the template node lets you inject all of this into the dashboard. My 'solution' isn't easy to customize, without the basic knowledge of this stuff. I just wanted to give you an idea of how it can be done.
In my template node a html layer is created (<div></div>). It has specific attributes like the id so I can easy find it with javascript. I've created a random number and stored it in msg.rand. Angular updates the content of the div every time a msg object is passed to the template node. The javscriptcode in the <script></script> block gets msg.rand from angularjs and checks its value. If there is a certain value the font-color of the div is set via css by javascript.
I hope this isn't too much confusing
So like you said the template node replaces the text node. I don't know why there is an output on the template-node. It just passes the msg object through.
I do not know either if the colouring of certain values can be done with angular js inside the text-node.