I am encountering an issue with my page that includes multiple AngularUI sliders and a span displaying the value of each slider using ng-bind. The structure looks similar to this:
<div class="formitem" ng-repeat="food in foodlist" >
<div ui-slider="{range: 'min'}" min="0" max="{{ unit.max }}" ng-model="demoVals.slider" class="food-slider" >
<div class="begin">1</div>
<div class="end"> {{ unit.max }} {{ food.uid }} </div>
</div>
<span ng-bind="demoVals.slider"></span>
</div>
I am aiming to make the ng-model unique for each food item, utilizing something like demoVals.slider57
, where 57 is derived from {{ food.uid }}
. While I can successfully display {{ food.uid }}
in the template, trying to integrate it into ng-model or ng-bind yields results like this:
ng-model="demoVals.slider[food.uid]"
How can I effectively incorporate the food.uid into the ng-model for each food item?