I have the following loop in which I try to increment several fields each time based on the index of the array through the loop.
<div class="individualwrapper" ng-repeat="n in [] | range:4"> <div class="iconimage"> </div> <div class="icontext"> <p>Imagine that you are in a health care facility.</p> <p>Exactly what do you think this symbol means?</p> <textarea type="text" name="interpretation_1" ng-model="interpretation_1" ng-required="true"></textarea> <p>What action you would take in response to this symbol?</p> <textarea type="text" name="action_1" ng-model="action_1" ng-required="true"></textarea> </div> </div>
I would like to do something like this "
ng-model="interpretation_{{$index + 1}}"
Angular does not display this value? What would be the best way to add this logic to the mg-model field?
javascript html angularjs angularjs-ng-model
byrdr
source share