title: How to send instance of ngFor to ngTemplate and pass into function?
body: <p>I have ngFor loop iterate elements of Cars array like below</p>
  <pre><code>Cars=[{id:3,name:&quot;Toyota&quot;},{id:8,name:&quot;Hyundai&quot;},{id:12,name:&quot;Lincoln&quot;}]
  
    &lt;div *ngFor=&quot;let car of Cars&quot;&gt;
       {{car.name}}
    &lt;ng-container *ngTemplateOutlet=&quot;indicator;context:car&quot;&gt;&lt;/ngcontainer&gt;
    &lt;/div&gt;
  </code></pre>
  <p>there will be also button near each car and via clicking,it will request to api.Not to repeat my code also for other components like car.I want to store it on the page with ng-template and call it several times when needed</p>
  <pre><code>&lt;ng-template #indicator let-car='car'&gt;
     &lt;button (click)=&quot;buyCar(car)&quot;&gt;Buy&lt;/button&gt;
  &lt;/ng-template&gt;
  </code></pre>
  <p>This doesnt work and as far as I know I can't use car instance directly within #indicator template.I can do something like let-id='id' and then car.id can be assigned with id name.But in the function buyCar() I need to send car instance not to ruin other functions and ifs.Is there anyway to make it work with instance as I mentioned?</p>