2

Okay, I have a weird issue. I have an array of objects. Each object contains another array (of strings). I loop over the array of objects using ng-repeat. Within the repeated code I ng-repeat over the array of strings. For some reason, this nested ng-repeat only works when the array of strings contains but one (1) item. When there are more items, it simply doesn't work.

Code

Result of <pre>{{ answer.value | json }}</pre>

[
  "Apothekerskast",
  "Apothekerskast",
  "Koelkast ombouw"
]

The view (in a gist because posting here causes issues with markdown): https://gist.github.com/fabdrol/898e4ac9760fc358ce81

The data (in JSON), for easy reading: https://gist.github.com/fabdrol/089467fa09dad6e89e81

1 Answer 1

3

It doesn't like duplicates, use track by $index:

ng-repeat="val in vals track by $index"

JSFiddle: http://jsfiddle.net/nedq13q2/

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

Comments

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.