Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  43] [ 1]  / answers: 1 / hits: 36982  / 11 Years ago, mon, april 1, 2013, 12:00:00

How would I hide the first element of an ng-repeat?



<div ng-repeat=item in items ng-hide=true>
<div>{{ item.value }}</div>
</div>


This works in that the whole ng-repeat block is hidden, but how would I hide only the first item in items? I want to display it completely differently using more prominent html/etc, so it's useful to have it in that list of data.


More From » angularjs

 Answers
367

You can do this



<div ng-repeat=item in items ng-show=!$first>
<div>{{ item.value }}</div>
</div>


Here are the docs: http://docs.angularjs.org/api/ng.directive:ngRepeat


[#79204] Saturday, March 30, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dominickmackenziet

Total Points: 583
Total Questions: 101
Total Answers: 117

Location: Saint Lucia
Member since Wed, Feb 8, 2023
1 Year ago
dominickmackenziet questions
Wed, Apr 7, 21, 00:00, 3 Years ago
Fri, Feb 12, 21, 00:00, 3 Years ago
;