ng-repeat-start

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 11 years ago
Updated 6 years ago

This short video tutorial looks at the ng-repeat-start and ng-repeat-end elements added in AngularJS 1.2

John Lindquist: In Angular 1.2 ng repeat now supports multiple elements. So if you put "ngrepeat-start" and then you loop through some things, I just have "app.things" set to "123." I can bind "things" here and then I have to close the ng repeat with a "-end." Once that's done, I can refresh and you can see "123."

Now I can add anything in here and then also in here with binding or whatever. And you can see it's repeating in all of those elements, anything inside of here, and anything inside of here. As long as these elements are sibling elements, it can find it, don't expect to be able to wrap this in another element, because if you try and do that, it will break down and throw an error of "no ng repeat found" or "no ng repeat end found."

Just make sure they are sibling elements and you should be good to go as far as repeating multiple elements.

Jae Sung Kim
Jae Sung Kim
~ 9 years ago

what is a use case for ng-repeat-start and ng-repeat-end in production? I don't see the need as we can just ng-repeat and put anything we want repeated in the tags

Markdown supported.
Become a member to join the discussionEnroll Today