title: How to use expression in ngIf-else in angular 2
body: <p>This is my piece of code</p>
  
  <pre><code>&lt;tr *ngFor="let sample of data; let i = index" [attr.data-index]="i"&gt;
      &lt;ng-container *ngIf="sample .configuration_type == 1; then thenBlock; else elseBlock"&gt;&lt;/ng-container&gt;
         &lt;ng-template #thenBlock&gt;
             &lt;td&gt;{{sample.item_number}}&lt;/td&gt;
             &lt;td&gt;{{sample.make}}&lt;/td&gt;
             &lt;td&gt;{{sample.model}}&lt;/td&gt;
         &lt;/ng-template&gt;
         &lt;ng-template #elseBlock&gt;
             &lt;td&gt;{{sample.serial_number}}&lt;/td&gt;
             &lt;td&gt;{{sample.capacity}}&lt;/td&gt;
             &lt;td&gt;{{sample.model}}&lt;/td&gt;
         &lt;/ng-template&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Error it displays as</p>
  
  <p>Can't bind to 'ngIfThen' since it isn't a known property of 'ng-container'.
  1. If 'ng-container' is an Angular component and it has 'ngIfThen' input, then verify that it is part of this module.
  2. If 'ng-container' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
   ("gFor="let sample of data; let i = index" [attr.data-index]="i"></p>