Am trying to implement ngif else in Angular12. But for some reason else part is not getting executed.The problem is if the image is not null it has to generate the cards with image. If the image is null i want some text inside the card mentioning "IMAGE NOT AVALIABLE".The else part is not working.can someone steer me in the right direction. Thanks
<ng-template [ngIf]="seasonsdetail.season?.length">
<ng-container *ngFor = "let seasons of seasonsdetail.season">
<div class="col-sm-2 col-md-3 col-lg-3">
<ng-container *ngIf="seasons.image.medium; else elseTemplate">
<div class="card" data-id='' >
<a href= ''><img class="card-img img-fluid " [src]='seasons.image.medium' alt="Seasons"></a>
</div>
<h4 class="card-title">
{{seasons.number}}
</h4>
</ng-container>
</div>
<ng-template #elseTemplate>
<div class="card" data-id='' >
<!--<div class="card-body"> -->
<h4>Image not Avaliable</h4>
<!--</div>-->
</div>
<h4 class="card-title">
{{seasons.number}}
</h4>
</ng-template>
</ng-container>
</ng-template>