{{ x[y] }}
Here's a jsfiddle, though the example is a bit contrived.
题
I have a repeater within a repeater, like so:
<div ng-repeat='x in collection1'>
<div ng-repeat='y in collection2'>
</div>
</div>
What I'm trying to do is access property y of object x, something like...
{{ x.{{y} }}}
or
{{ x[ {{y}} ] }}
...but when I try this I get an error along the lines of..."Syntax Error: Token 'y' is unexpected, expecting [:]."
Is there any way to do something like this with Angular or am I boned here?
解决方案
{{ x[y] }}
Here's a jsfiddle, though the example is a bit contrived.