0

I have code like this:

<my-dropdown>
  <li ng-repeat="item in items"><a>{{item.text}}</a></li>
</my-dropdown>

and I need to hide all li except one (I have ng-transclude in 2 places) but I can't access the source html, I can't modify the code before angular will read it and I can't access DOM after ng-repeat.

jcubic
  • 61,973
  • 54
  • 229
  • 402
  • Why are you asking the same thing twice?? http://stackoverflow.com/questions/24513237/directive-that-run-after-ng-repeat – JoseM Jul 01 '14 at 17:11
  • @JoseM the question was different but the code was the same. I've changed title and it appear as the same. I'll change title to be exactly what have in text. – jcubic Jul 01 '14 at 18:55

1 Answers1

-1

One way to do it:

<my-dropdown>
<li ng-repeat="item in items" ng-hide="$index!=2"><a>{{item.text}}</a></li>
</my-dropdown>

Will hide all but the third li

Rusty
  • 329
  • 1
  • 8