Is it possible to have a list of messages displayed using ng-repeat and load older messages via ion refresher when the user scrolls to the top? The goal is for the older messages to be added above the current messages while maintaining the scroll position of the current messages.
HTML
<ion-content id="messageScroller" delegate-handle="userMessageScroll">
<ion-refresher pulling-icon="ion-ios-arrow-thin-down" refreshing-text="loading messages" on-refresh="moreMessages()">
</ion-refresher>
<div ng-repeat="message in convo.messages">
{{message.text}}
</div>
</ion-content>
JS
$scope.moreMessages = function() {
$scope.convo.messages = olderMessages().concat($scope.convo.messages)
}
One issue is that when more messages are loaded, the ion-content automatically scrolls to the top, which is not desired.
Is there a way to maintain the scroll position so that loading older messages simply makes them accessible by scrolling up, similar to how it works in iMessage or other chat apps?