Bind a point value directly to a slider
-
How would you bind a data point directly to a slider component without using the dropdown in the examples? I would like to use a slider similar to the way you can use a set point value component in dashboard designer just by giving it the point name.
for example: set point value component works great just giving it point="(point's XID)" but slider is looking for ng-model="myPoint.valueFn". how would I define myPoint as a point that I have created in data sources.
Thanks,
-
I believe doing this is partially demonstrated in this example page:
http://localhost:8080/ui/examples/setting-point-values/sliders
but it sounds like you want to hard code a data point rather then using a dropdown to select one, so you would use
<ma-get-point-value>
rather then<ma-point-list>
. I updated the example to show you how to do so:<div layout="column"> <h2>Hard Coded Point Slider</h2> <ma-get-point-value point="myPoint" point-xid="Demo 01-setpoint"></ma-get-point-value> <md-slider ng-disabled="!myPoint.enabled" md-discrete step="1" min="0" max="100" ng-model="myPoint.valueFn" ng-model-options="{getterSetter:true}"> </md-slider> </div> <md-slider-container ng-disabled="!myPoint.enabled"> <md-input-container> <input flex step="1" min="0" max="100" type="number" ng-model="myPoint.valueFn" ng-model-options="{getterSetter:true}"> </md-input-container> <md-slider step="1" min="0" max="100" md-discrete ng-model="myPoint.valueFn" ng-model-options="{getterSetter:true}" md-vertical></md-slider> <h5>Value: {{myPoint.value}}</h5> </md-slider-container>
Just update the
point-xid
attribute to match that of your point -
That's what I needed. Thank you so much!