I'm new to Angular, and I need help with displaying a message when there is no data to show.
Here's my component.html part:
<app-header [isHidden]="isHiddenProgressBar"></app-header>
<div class="change">
<button (click)="changeState()" *ngIf="showButton" color="primary" mat-raised-button>Change state</button>
</div>
<div class="list">
<app-list *ngIf="visible" [changeObjects]="data"></app-list>
</div>
And I have a boolean in the .ts file as follows:
this.data = this.objects;
this.visible = this.objects != null && this.objects.length > 0;
this.showButton = true;
}
I would like the component to display the list if there's data to show, otherwise I would like to display a message like 'The list is empty.'
Thank you for your help!