質問

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top