Alex Rivera | Logout

angular ng-repeat expressions as variables

Asked 2013-07-31T13:06:46.800
16

I'm trying to do something like this:

<ul>
    <li ng-repeat="{{myRepeatExpression}}">{{row.name}}</li>
</ul>

But because the ng-repeat logic is in the compile state of the directive it treats the {{myRepeatExpression}} as a normal string instead of a variable. Which doesn't work, obviously.

Is there any workaround for that?

Edit
Report

1 Answer

2

ng-repeat only accepts it proprietary expression syntax as in row in rows, but rows could be a function or promise in your controller. However you need to watch performance closely as ng-repeat doesn't work well with things that change too often (the dreaded max. 10 iterations error).

answered 2013-07-31T13:35:35.043

Your Answer