Significance of ng-repeat-start vs ng-repeat

The significance of these two directives is similar: they repeat HTML-tags. The difference is only that with help of ng-repeat-start you could repeat few tags starting from tag with ng-repeat-start and finishing by ng-repeat-end.

For example you have next code:

<div>
  Item # {{item}}
</div>
<div>Whether you repeat me?</div>

So now we can add 2 directives for these code.
With ng-repeat:

<div ng-repeat="item in items">
  Item # {{item}}
</div>
<div>
  This code will not be repeated
</div>

With ng-repeat-start and ng-repeat-end:

<div ng-repeat-start="item in items">
  Item # {{item}}
</div>
<div ng-repeat-end="">This code will be repeated</div>

So now you can see that in the first case just div with ng-repeat directive repeats, but in the second case both your divs will be repeated.

You can see Demo and play with it:

Demo: http://plnkr.co/edit/R778lWTABVF3Hy16CAca

Leave a Comment