title: Dynamically set attribute on component in html template angular 2
body: <p>I am trying to set an attribute on a component if a certain expression is true. Could someone give me an example? </p>
  
  <p>What I have now:</p>
  
  <pre><code> &lt;div [danger]="inArray(choice.likers, user, id)"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>but this does not compile.</p>
  
  <p>inArray is my own method which returns true or false.
  What I would like to see is, if the expression returns true, the output will be</p>
  
  <pre><code>&lt;div danger&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In angular 1 there was this: ng-attr-... statement that did exactly the above.</p>