ng-if condition used with point query
-
This supplies my serialChart with 8 dataPoints from my plc and works fine...
<div ng-model="theDevice" ng-init="theDevice='unit#1_plc'" ></div> <ma-point-query query="{$and: true, deviceName:theDevice, name:ptName}" limit="8" points="points"></ma-point-query> <ma-point-values points="points" values="combined" from="from" to="to" ></ma-point-values>
This does not... but why not?
<div ng-if="true" ng-model="theDevice" ng-init="theDevice='unit#1_plc'" ></div> <ma-point-query query="{$and: true, deviceName:theDevice, name:ptName}" limit="8" points="points"></ma-point-query> <ma-point-values points="points" values="combined" from="from" to="to" ></ma-point-values>
-
I'd wager the ng-if is looking for a variable called true. Check your console for errors.
Why do you want the ngif there in the first place?Fox
-
ye true is probably returning as undefined.
-
thanks guys,
here is my reasoning:
I was testing 2 datapoints on 2 different plc. if they were equal, then plc1 would be my source for the seriesChart, if false then plc2. the ng-if was going to help me swap out the devices . I did have a variable that tested the condition and it did evaluate to true or false but when plan didnt work i started to backup and check why.
-
Use <ma-get-point-value> for both points.
2) in your ng if, use both points with the challenge:ng-if="pt1.value==pt2.value"
This way you are comparing two variables to see if they are the same/both equal to one another.
For false simply:
ng-if="pt1.value!=pt2.value"
That should you help you with where you want to go!
Fox