I want to limit the number of lines that a <p>
can have, based on a text in ng-repeat
, my ng-repeat loop
:
<ul class="list-unstyled">
<li ng-repeat="comment in ad.comments>
<p id="moreButton"> {{comment.text | limitTo: CommentTextLimit}}
<a ng-show="comment.text.length>25"> <span id="moreLess" span ng-click="changeLength(CommentTextLimit)" >{{moreLessText}}</span></a>
</p>
</li>
</ul>
I want to limit the comment.text
field and if the user clicks on the show more
button more lines will appear, the first problem is that any changes apples to all comments instead of one, the second one is that I want to limit by rows and not by comment.text.length