Display two item from array with ng-repeat


#1

Hi
I have array with these item

"Players" :[
           "Tom",
           "Henry",
           "John",
           "Frank",
            "Cruz"
]

how can I use ng-repeat to display player number 1 and 2 only
I try this but not work for me

 <p ng-repeat="line in Players [0,1]">{{line}}</p>

any one know how to fix this - Notice this ionic version 1


#2

Please try to search on the web before posting…
<p ng-repeat="line in Players|limitTo:2">{{line}}</p>
This should do the job.


#3

Thanks Kocei -well done - I liked your help