I am facing a little issue trying to make this *ngIf statement work as expected. My goal is to display the div only if it is empty and the user viewing it is the owner. If the user is a guest and the div is empty, then it should not be shown. Here is my current attempt:
<div *ngIf="(tray.flyers.length === 0) && (isOwner === true)"></div>
This code will show the div when the user is the owner and the div is empty. However, I am unsure how to add a condition that will hide the div if the user is a guest and the div is empty.
I have been struggling with this issue for a few hours now and can't seem to find a solution. I know I could achieve this by handling everything in the component and using:
<div [hidden]="isTrayEmpty"></div>
But ideally, I would prefer to accomplish this directly in the HTML if possible. I'm not sure if it's even feasible though.
Any help or guidance you could provide would be greatly appreciated. Thank you!