Friday, November 27, 2015

Difference between ng-repeat-start and ng-repeat-end: Angular

ng-repeat and ng-repeat-start works similar and for ng-repeat-start required an ng-repeat-end. We can check in detail with examples.

ng-repeat



$scope.items = ['one','two','three'];

<span ng-repeat = "item in items">{{item}}</span>


output



 one
 two
 three


ng-repeat-start and ng-repeat-end



<span ng-repeat-start = "item in items">
    start {{item}}
</span>     

<span>{{item}}</span>

<span ng-repeat-end = "item in items">
    end {{item}}
</span>


Output



 start one
 one
 end one

 start two
 two
 end two

 start three
 three
 end three


Here you can see it is repeating all the html code as well. Instead of repeating only parent element we can repeat series of elements as well.

Related Posts

1. Angular select all/de select all checkbox.

2. How to check lowercase in indexOf of an Array

3. Covert string to camel case using javascript

4. How to remove duplicate from an array and get count of duplicated .


1 comment :