I am currently working on developing a web chat application using ionic, and I have encountered an issue with loading and displaying messages. Below is the code snippet that I am using to load messages from the database:
<ion-item *ngFor="let mesage of messages | slice: 0:slice" class="msg">
<ion-row>
<ion-text color="tertiary"><b>{{ mesage.user }}: </b></ion-text>
<ion-text color="secondary"> {{ mesage.text }}</ion-text>
</ion-row>
</ion-item>
Currently, my code loads messages starting from the first one in the database up to message[slice]. However, I am facing difficulty in only displaying the last 10 messages and then dynamically loading new ones as they arrive.