Here is a sample HTML code:
<div ng-repeat="item in items()">
<input type="checkbox" ng-model="anObject[item.name]">
</div>
I am trying to access a property that depends on the item.name
within my $scope.anObject
which I defined in my controller. However, neither of the attempts above seem to work.
<div ng-repeat="item in items()">
<input type="checkbox" ng-model="anObject.{{item.name}}">
</div>
UPDATE: You can check out a working example here.