title: Is it possible to assign a value to a variable with let in an angular component template?
body: <p>Consider this snippet:</p>
  
  <pre><code>&lt;div class="col-4" style="text-align: center;"&gt;
      &lt;skin-stat-circle&gt;{{statByType('Users')?.count}}&lt;/skin-stat-circle&gt;&lt;br&gt;
      &lt;span&gt;{{statByType('Users')?.label}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is it possible to assign <code>statByType('Users')</code> to a local template variable a bit like as in <code>*ngFor</code> using <code>let...</code> ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Worked it out with the help of @incaner. This is powerful - like it a lot.</p>
  
  <pre><code>&lt;ng-template #statTemplate let-stat="stat"&gt;
     &lt;div class="col-4" *ngIf="stat"&gt;
        &lt;skin-stat-circle &gt;{{stat.count}}&lt;/skin-stat-circle&gt;
        &lt;br&gt;
        &lt;span&gt;{{stat.label}}&lt;/span&gt;
     &lt;/div&gt;
  &lt;/ng-template&gt;
  &lt;skin-stat-group&gt;
     &lt;div class="container"&gt;
        &lt;div class="row"&gt;
           &lt;ng-container *ngTemplateOutlet="statTemplate;context:{stat: statByType('Users')}"&gt;&lt;/ng-container&gt;
           &lt;ng-container *ngTemplateOutlet="statTemplate;context:{stat: statByType('Projects')}"&gt;&lt;/ng-container&gt;
           &lt;ng-container *ngTemplateOutlet="statTemplate;context:{stat: statByType('Layers')}"&gt;&lt;/ng-container&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/skin-stat-group&gt;
  </code></pre>