Enter Your Email Address to Watch This Lesson

Your link to unlock this lesson will be sent to this email address.

Unlock this lesson and all 960 of the free egghead.io lessons, plus get Angular 1.x content delivered directly to your inbox!



Existing egghead members will not see this. Sign in.

ng-repeat-start

1:26 Angular 1.x lesson by

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

Get the Code Now
click to level up

egghead.io comment guidelines

Avatar
egghead.io

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

Avatar
Roshan

Hi ,
The current video does not really point out the situation where should this tag be used instead of ng-repeat .
"http://blog.nitishkumarsingh.com/advantage-of-ng-repeat-start-and-ng-repeat-end-repeating-over-multiple-elements/"

The blog here however points out a clear example .

Probably , the video can be updated to something on similar lines .

In reply to egghead.io
Avatar
Jae Sung Kim

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

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.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?