title: Angular 2 way of adding conditional classes to HTML tags
body: <p>I have this button:</p>
  
  <pre><code>&lt;button class="btn btn-primary btn-sm" (click)="addSupplier(item)"&gt;Save&lt;/button&gt;
  </code></pre>
  
  <p>I would like to add a class 'disabled' that will only applied when a certain condition is true, and will not apply when it is false.</p>
  
  <p>What is the Angular 2 way of doing this?
  I came up with this approach using *ngIf but it's a ton of code:</p>
  
  <pre><code>&lt;div *ngIf="item.productId &amp;&amp; item.supplier"&gt;
      &lt;button class="btn btn-primary btn-sm" (click)="addSupplier(item)"&gt;Save&lt;/button&gt;
  &lt;/div&gt;
  &lt;div *ngIf="!item.productId || !item.supplier"&gt;
      &lt;button class="btn btn-primary btn-sm disabled" (click)="addSupplier(item)"&gt;Save&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>