2

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?

1

1 Answer 1

6
{{ x[y] }}

Here's a jsfiddle, though the example is a bit contrived.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. This was actually the first thing I'd tried, but it turns out my object wasn't set up like I expected. I was looking for x[firstName] when I needed x.name[first] etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.