Let's say I have a controller that contains an array property named 'houses'
. I want to use ng-repeat
to display this array on a table row with a set of radio buttons (true/false, etc.). How can I ensure that selecting any of these radio buttons will update the corresponding item in the model array? I attempted to set the ng-model attribute on the radio buttons like so:
ng-model="array[{{$index}}]"
Unfortunately, this approach did not work as expected. Instead of getting the index value, I ended up with the literal string '$index'. Has anyone successfully achieved this functionality in Angular before?