I try to display a part of a list of item (pagination). My template :
<div class="notif" *ngFor="let notif of paginate() | async">
{{notif.name}}
</div>
In my component if I do :
public notifications: Observable<Notification[]>;
public paginate(): Observable<Notification[]> {
return this.notifications;
}
This is working, but if I do :
public notifications: Observable<Notification[]>;
public paginate(): Observable<Notification[]> {
return this.notifications.map((notif: Notification[]) => {
return notif;
});
It doesn't work anymore (I've simplified the function to understand what's going on). .map retuns an observable right? So it should work both ways?