There are 2 functions in my code
loadItems(): void {
this.service.query().subscribe((res: HttpResponse<Item[]>) =>
(this.items = res.body || []));
}
loadAuditByItem(item: Item) {
this.service.auditByItem(item.id!).subscribe((res: HttpResponse<ItemAudit[]>) =>
(this.auditByItem = res.body || []));
}
I am trying to showcase data from both loadItems() and loadAuditByItem() on the same page. I have successfully displayed the name and description from loadItems(), but I also need to show the "createdBy" information from loadAuditByItem(item).
<div *ngFor="let item of items">
<div *ngIf="loadAuditByItem(item)">
<span>Name: {{ item.name}}</span>
<span>Description : {{ item.description }}</span>
<span>Created by: {{ auditByItem .createdBy}}</span>
</div>
</div>