在AngularJS的ngRepeat声明中使用$index

在AngularJS的ngRepeat声明中使用$index,angularjs,Angularjs,我在json属性中有唯一标识符的数据,我想在ng repeat指令中访问它 这失败了: <tr ng-repeat="shape in 'shapes.id_'+$index+'.objects')"></tr> 你知道我该怎么做吗?我想也许用函数调用 <tr ng-repeat="shape in shapes($index))"></tr> ng repeat=形状中的形状['id\'+$index].objects'美元索引从何而来?在控

我在json属性中有唯一标识符的数据,我想在ng repeat指令中访问它

这失败了:

<tr ng-repeat="shape in 'shapes.id_'+$index+'.objects')"></tr>
你知道我该怎么做吗?我想也许用函数调用

<tr ng-repeat="shape in shapes($index))"></tr>

ng repeat=形状中的形状['id\'+$index].objects'美元索引从何而来?在控制器中计算一个包含相关项的有效数组并将其存储在作用域中是否更有意义?您能给我们一个“shapes”json对象的示例吗?json对象结构会很有帮助。CodeHater的答案很有效,如果我能通过这个监视器拥抱他,我会的!