My ng-model looks like this:
<tr ng-repeat="user in users">
<input type="text" ng-model="code[user.id]"/>
When I set $scope.code = {0: 'value'};
, it works fine. However, if I try to pass a dynamic value like:
var index = 0;
$scope.code = {index: 'value'}
it doesn't work as expected.
My question is, how can I pass a dynamic value inside the {}?