Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson

Already subscribed? Sign In

Autoplay

    ng-repeat-start

    John LindquistJohn Lindquist

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

    angularjsAngularJS
    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Transcript

    Transcript

    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.

    Discuss

    Discuss