title: How to create an angular template variable
body: <p>I have several buttons that are disabled based on what a function returns. How can I reuse the value returned from <code>isDisabled(product)</code> without calling <code>isDisabled(product)</code> for every single button? The calculations within isDisabled() is long so I don't want to have to repeat it.</p>
  
  <p>Currently the code looks like this:</p>
  
  <pre><code>&lt;div *ngFor="let product of prodList"&gt;
     &lt;button [disabled]=isDisabled(product)&gt;...&lt;/button&gt;
     &lt;button [disabled]=isDisabled(product)&gt;...&lt;/button&gt;
     &lt;button [disabled]=isDisabled(product)&gt;...&lt;/button&gt;
     &lt;button [disabled]=isDisabled(product)&gt;...&lt;/button&gt;
     &lt;button [disabled]=isDisabled(product)&gt;...&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>