I have a problem with displaying Observable object in component.
My Json structure is:
{
"data": [
{
"id": "123",
"name": "test",
}
],
"pagination": null
}
So I have created interface to map this json to .ts
export interface Paginated<T>{
data: Array<T>;
pagination: Pagination;
}
In my component I have Observable object for this json:
this.httpClient.get<Paginated<Event>>(`${environment.apiUrl}/events`);
And I do not have idea how to display property data which is inside Observable<Paginated> with using async pipe, because this json is not an array - it is object with two property - data and pagination so I cannot just simply use *ngFor with async pipe, because this object is not an array.
So my question is how to display in component this property data when I received Observable<Paginated> I cannot use *ngFor... how to unpack data property from this Observable<Paginated>