Hi Jared,
Thanks for your answer, I implemented the first option and it works great :)
I'm not using the UI module, I'm creating my dashboard through the 'Edit pages', as it offers much more flexibility than through the dashboard designer. Sorry for mixing it up, I'm new at Mango.
Now I need to display different text (within the same SVG file) depending on the combination of values...
I've tried the same sort of structure:
<div ma-selector="#meterState001 tspan" ng-bind="{'Empty': !plug1.value && !switch1.value, 'Error': !plug1.value && switch1.value, 'PluggedIn': plug1.value && !switch1.value, 'Charging': plug1.value && switch1.value}"></div>
But this displays the ng-bind as a string, and not 'Empty', 'Error', 'Plugged In' or 'Charging'. Different combinations of curly brackets and quotation marks result in it not working at all.
I've also tried ternary operators:
{plug1.value ? (switch1.value ? 'Charging' : 'Plugged In') : (switch1.value ? 'Error' : 'Empty')
Which doesn't work.
And ng-if:
<div ma-selector="#meterState001 tspan" ng-if="(plug1.value == false) and (switch1.value == false)" ng-bind="Empty"></div>
<div ma-selector="#meterState001 tspan" ng-if="(plug1.value == false) and (switch1.value == true)" ng-bind="'Error'"></div>
<div ma-selector="#meterState001 tspan" ng-if="(plug1.value == true) and (switch1.value == false)" ng-bind="'Plugged In'"></div>
<div ma-selector="#meterState001 tspan" ng-if="(plug1.value == true) and (switch1.value == true)" ng-bind="'Charging'"></div>
But it only reads the last ng-if and it ignores the others.
I've also tried ng-switch:
<div ng-switch on="switch1.value">
<div ng-switch-when="true">
<span ma-selector="meterState001 tspan" ng-bind="'Charging'"></span>
</div>
<div ng-switch-when="false">
<span ma-selector="meterState001 tspan" ng-bind="'Plugged In'"></span>
</div>
</div>
But no more luck than with the others.
I've been researching on the Internet but I can't find anything that will work.
I'd appreciate any thoughts, as this is starting to drive me slightly insane!
Thanks! :)
Silvia