title: Angular ngIf else is not working inside ng-container
body: <p>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 &quot;IMAGE NOT AVALIABLE&quot;.The else part is not working.can someone steer me in the right direction. Thanks</p>
  <pre><code>&lt;ng-template [ngIf]=&quot;seasonsdetail.season?.length&quot;&gt;
        &lt;ng-container *ngFor = &quot;let seasons of seasonsdetail.season&quot;&gt;
          &lt;div class=&quot;col-sm-2 col-md-3 col-lg-3&quot;&gt;
            &lt;ng-container *ngIf=&quot;seasons.image.medium; else elseTemplate&quot;&gt;
              &lt;div class=&quot;card&quot; data-id='' &gt;
                  &lt;a href= ''&gt;&lt;img class=&quot;card-img img-fluid &quot; [src]='seasons.image.medium' alt=&quot;Seasons&quot;&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;h4 class=&quot;card-title&quot;&gt;
                {{seasons.number}}
              &lt;/h4&gt;
            &lt;/ng-container&gt;
          &lt;/div&gt;
          &lt;ng-template #elseTemplate&gt;
            &lt;div class=&quot;card&quot; data-id='' &gt;
              &lt;!--&lt;div class=&quot;card-body&quot;&gt; --&gt;
                &lt;h4&gt;Image not Avaliable&lt;/h4&gt;
              &lt;!--&lt;/div&gt;--&gt;
            &lt;/div&gt;
            &lt;h4 class=&quot;card-title&quot;&gt;
              {{seasons.number}}
           &lt;/h4&gt;         
          &lt;/ng-template&gt;
        &lt;/ng-container&gt;
      &lt;/ng-template&gt;
   
  </code></pre>