I would like to use a slider (ionic range) to step through the strings in an array.
Here is a codepen to illustrate what I mean.
The issue where is that I am going to be mixing different ranges and arrays of values and strings depending on the item selected.
Here is and example of my ng-repeat
which will iterate over the objects to display the range inputs.
<div ng-repeat="paramObj in activeExercise.Params track by $index">
<div class="item item-divider">
{{paramObj.param}}: {{activeExercise.paramters.paramObj.childParam}}
</div>
<div class="item range">
<i class="icon orange" ng-class="paramClass(paramObj.param)"></i>
<input type="range" name="parameter" min="0" ng-model="paramObj.childParam" max="100" value="0">
<i class="icon"></i>
</div>
</div>
An example object is here:
$scope.activeExercise = {
"exerciseID": "442",
"exerciseName": "4 Point Kneeling Lumbar Flexion",
"Params": [{
"childParam": "",
"param": "Reps"
}, {
"childParam": "",
"param": "Colour"
}]
}
$scope.colourArray = [
"Red",
"Blue",
"Red",
"Yellow"
];
Question:
Is it possible for a range slider to iterate through the string array rather than iterating through a range of numbers?
I would need this to work conditionally depending on the value in the object (colours would be strings and reps / sets would be numbers.).
Expected behaviour:
An exercise can have several parameters (Reps, Sets, Weight, Colour). For parameters that utilise numbers then the range is ideal. However for the colour parameter, I need it to step through an array of strings rather than using numbers.
Many thanks for any help you may be able to offer.