I am trying to access the comments array for each user, but I need to create an interface similar to the one shown in the image.
https://i.sstatic.net/2hsIn.png
Although I am able to retrieve everything else, I am having trouble accessing this particular property. In my code, I have implemented the following:
personSubject = new BehaviorSubject<any>(null);
person$: Observable<any> = this.personSubject.asObservable();
getAllPosts(event?) {
this.authService.getAllPosts().pipe(takeUntil(this.destroy$)).subscribe((res: any) => {
console.log(res);
this.allPosts = res.length;
this.down = res.length;
this.personSubject.next(res.data.post)
})
}
*ngFor="let i=index; let post of person$ | async | sortPipe"
How can I properly handle this interface?