I have an ng-repeat list that starts with 10 items. I would like to add new items at the end of the list (bottom) If I currently run the function it will add items to the top of my list.
I know that you can add items with .push() and .unshift() but this is not working with the code I use.
This is my code (I use a code snippet from Pubnub to fetch history items):
$scope.messages = [];
$scope.loadMore = function() {
var timeToken = $('.lastMessage').attr('timetoken');
console.log(timeToken);
// Populate message history
PubNub.ngHistory({
start: timeToken,
channel: $scope.channel,
count: 5,
});
};
html:
<ion-item ng-repeat="message in messages track by $index">