I have a variable called param
within the scope as $scope.param
, which is always set to either foo
or bar
. I am constructing a table with rows defined by <tr ng-repeat="d in data">
.
When I use <td>{{d.foo}}</td>
or <td>{{d.bar}}</td>
, everything works perfectly and the data displays correctly. However, if I use <td>{{d.param}}</td>
, Angular fails to find any data and the cell remains empty.
In simple terms, I am attempting to access a value of an object using a variable as the key instead of the key itself. Is there a way to achieve this?