Hello - I've been dinking around with an if statement in the ui template for several days now and haven't been able to figure it out.
I'm trying to load an svg file base on the msg.payload from the darksky node.
For example, if the msg.payload is partly-cloudy-day I want to load a svg titled partly-cloudy-day.svg, if the msg.payload is fog load fog-1.svg and so on. I made the changes required to setting.js httpStatic: 'C:\Users\unpue\public', I serve a background picture with this setup so I know it works.
I can open the link to the svg file on Chrome by looking it up like this
This is the flow
and here what I have in the template node, I removed the first <div just left div in its place because it kept trying to load the svg and wouldn't just show the script.
<div> ng-if= "msg.payload === partly-cloudy-day" img src="/weather-icons/weather/partly-cloudy-day.svg" </div> <div. ng-if="msg.payload === fog" img src="/weather-icons/weather/fog-1.svg" </div> <div> ng-if="msg.payload === sunny" img src="/weather-icons/weather/day.svg" </div>
this is what the msg.payload looks like
Appreciate the help!