• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    ng-if condition used with point query

    Dashboard Designer & Custom AngularJS Pages
    3
    5
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dgm
      last edited by

      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>
      
      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        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

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • CraigWebC
          CraigWeb
          last edited by

          ye true is probably returning as undefined.

          1 Reply Last reply Reply Quote 0
          • D
            dgm
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • MattFoxM
              MattFox
              last edited by MattFox

              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

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              1 Reply Last reply Reply Quote 0
              • First post
                Last post