title: angular 2 - checkbox "checked" depend on function not on property biind
body: <p>I have a checkbox that needs to be shown as selected depending on a function result instead of binding it to an object property.</p>
  
  <p>This would be easy, but is not possible:</p>
  
  <pre><code>&lt;input type="checkbox" ([ngModel])="category.selected"&gt;
  </code></pre>
  
  <p>And this does not work, as even <code>checked="false"</code> results in a checkbox being displshownayed as selected:</p>
  
  <pre><code>&lt;input type="checkbox" [attr.checked]="isCategorySelected(category.id)"/&gt;
  </code></pre>
  
  <p>I need an outcome like this</p>
  
  <pre><code>&lt;input type="checkbox"&gt;
  &lt;input type="checkbox" checked&gt;
  </code></pre>
  
  <p>depending on the result <code>isCategorySelected(id)</code>.</p>
  
  <p>Any help is appreciated.</p>