Pass messages to UI template using Jquery

I am using a UI Template node to to a scope watch to update changes for display. I am currently using this code:

    (function(scope) {
        //hide this card. NOTE: 4b689f7473831a84 is the Node id as 
        //seen in the INFO panel on the sidebar when you select this node
        scope.$watch('msg', function(msg) {
            if (msg.topic == "wx") {
                $("#header-thermometer").html("<i class='fa fa-thermometer-half' aria-hidden='true'></i>").css("color",'#98FF55');

The only way I could pass a message to the Jquery was by using above format. If I tried to type a command such as:

<i class="wi wi-direction wi-from-{{msg.windir}} wi-1x" style="color:#A6EDF8";>&nbsp</i>

The message was not picked up.. I ended up coding the entire html line as a msg object. The html format works if I hard code the value and use it instead of the .html(msg.object). Is there a way to embed the message in a Jquery html statement?


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