• 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

    How to set this value on loading the page

    Dashboard Designer & Custom AngularJS Pages
    2
    2
    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.
    • V
      v8dave
      last edited by

      I have a set of buttons that pass in from and to dates with a rollup-interval but this is not set when the page loads.

      How can I set this value in entry to the setting "1 minutes"

      <ma-now update-interval="1 minutes" output="to"></ma-now>
      <ma-calc input="now | moment:'subtract':subtractX:subtractUnit" output="from"></ma-calc>
      
      <md-button class="md-raised" ng-click="subtractX=1;subtractUnit='day'; rollupInterval='1 minutes'">Last 24 hours</md-button>
      <md-button class="md-raised" ng-click="subtractX=7;subtractUnit='day'; rollupInterval='10 minutes'">Last week</md-button>
      <md-button class="md-raised" ng-click="subtractX=30;subtractUnit='day'; rollupInterval='30 minutes'">Last month</md-button>
      
      <ma-point-values point="oilbbl1" values="oilbbl1Values" from="from" to="to" rollup="AVERAGE" rollup-interval="{{rollupInterval}}"></ma-point-values>
      
      1 Reply Last reply Reply Quote 0
      • Will GellerW
        Will Geller
        last edited by

        You will want to use ng-init. you can pretty much put it anywhere on the page but I usually put them on a parent div or just drop one in like:

        <div ng-init="rollupInterval='1 minutes'"><div>
        

        You can put any angular expressions in ng-init similar to what you are doing on ng-click. The code will just be run automatically run on page load rather then after a click event.

        Infinite Automation - UI Developer

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