I am working out some code for some application. I want to limit the messages in the chat
this.limitM = -10;
$scope.msgsCount = //contains the number of messages
<button ng-if="msgsCount > -main.limitM"
ng-click="main.limitM=-10+main.limitM">Load More</button>
<li class="singleMessage clearfix"
ng-repeat="msg in chat.msgs | limitTo:main.limitM"
ng-class="::{myMessage: msg.senderName != chat.name}">
<img class="profileImage" alt="::{{chat.name}}" width="40px">
<p ng-bind-html="parseMsg(msg)"></p>
</li>
This is not limiting the messages, all the messages appear. Can anyone help ?