I am trying to display part of a list of items (pagination). My template:
<div class="notif" *ngFor="let notif of paginate() | async">
{{notif.name}}
</div>
In my component, if I do this:
public notifications: Observable<Notification[]>;
public paginate(): Observable<Notification[]> {
return this.notifications;
}
This works, but if I do this:
public notifications: Observable<Notification[]>;
public paginate(): Observable<Notification[]> {
return this.notifications.map((notif: Notification[]) => {
return notif;
});
This does not work anymore (I simplified the function to understand what is happening). .map removes watched right? Therefore, should it work in both directions?
source
share