I created 'show more' link for dynamic list items which have more than three items but I have a problem with change this link to 'show less' after click 'show more'. I need two another icon for that. Any ideas how I can change it? It is possible to create it only with ng directives in HTML without functions in a controller?
My code:
<ul ng-if="::document.actUnitMonographViewList" class="commentary-snippets">
<li ng-repeat="monograph in document.actUnitMonographViewList | limitTo:showMore ? document.actUnitMonographViewList.length : 3">
<i ng-if="document.actUnitMonographViewList.length > 1"
class="fa fa-chevron-right"></i>
<a href="" ng-href="{{ ::getPublicationLink(monograph, 'monograph') }}"
ng-class="{'arrow-link': document.actUnitMonographViewList.length > 1}"
user-preferences-target>{{::monograph.title}}
</a>
</li>
<li ng-show="document.actUnitMonographViewList.length > 3">
<i class="fa fa-chevron-down"></i>
<a ng-click="showMore = true">Show more</a>
</li>
<li ng-show="document.actUnitMonographViewList.length > 3">
<i class="fa fa-chevron-up"></i>
<a ng-click="">Show less</a>
</li>
</ul>