Dropdown selection for datapoint values
-
Ok, I'm gonna be clever...
<md-select ng-model="serialID" ng-required="true" > <md-option ng-repeat="(index,serial) in serials" ng-value="index" > {{serial.value}} </md-option> </md-select> <div ng-if="serialID==(serials.length-1)"> <ma-now update-interval="15 MINUTES" output="time"></ma-now> <ma-point-values point-xid="DP_bf4e8b98-ff25-439c-a63e-4af21bc92902" point="point1" values="point1Values" from="serials[serialID].timestamp" to="time" ></ma-point-values> </div> <div ng-if="serialID<(serials.length-1)"> <ma-point-values point-xid="DP_bf4e8b98-ff25-439c-a63e-4af21bc92902" point="point1" values="point1Values" from="serials[serialID].timestamp" to="serials[(serialID+1)].timestamp" ></ma-point-values> </div>
Using Ng-if will create these elements provided one of the if statements are met. Using the index allows us to make this list grow wholly depending on the number of your serials. If you're on the last serial, it sees we're using the last index and thus uses a ma-now directive to give us the browser time from the serial creation time!
Fox
-
@mattfox
Perfect thats working for meThank you very much Mattfox
-
You're welcome, sorry for the lack of comments. Let me know if there's anything you don't understand after comparing it with the angularJS docs
Fox