title: *ngIf alternative to set button text in angular 2?
body: <p>I am trying to set button name programmatically using <code>*ngIf</code> in <strong>Angular 2</strong> </p>
  
  <p>My html mock up looks like this </p>
  
  <pre><code> &lt;button type="button" class="btn btn-primary" style="margin-top:5px;" (click)="setDefaultAttachment(img.id)"  *ngIf ="defaultAttaschmentId === img.id ? buttonName ='Default Image' : buttonName ='Set As Default'" &gt; {{buttonName}}&lt;/button&gt;
  </code></pre>
  
  <p>My <code>setDefaultAttachment</code> method looks like this : </p>
  
  <pre><code>setDefaultAttachment (id:number){
     this.defaultAttaschmentId = id ;
  }
  </code></pre>
  
  <p>but I am getting this error : </p>
  
  <blockquote>
    <p>EXCEPTION: Error: Uncaught (in promise): Template parse errors:
    Parser Error: Bindings cannot contain assignments at column 52 in [ngIf defaultAttaschmentId === img.id ? buttonName ='Default Image' : buttonName ='Set As Default'] in AttachmentsTabComponent@29:126 ("pe="button" class="btn btn-primary" style="margin-top:5px;" (click)="setDefaultAttachment(img.id)"  [ERROR ->]*ngIf ="defaultAttaschmentId === img.id ? buttonName ='Default Image' : buttonName ='Set As Default'""): AttachmentsTabComponent@29:126*** </p>
  </blockquote>