title: KnockoutJS "if: " binding not working properly
body: <pre><code>// Model
  function User(item) {
    var self = this;
    this.id = ko.observable(item.id);
    this.name = ko.observable(item.name);
    this.surname = ko.observable(item.surname);
    this.email = ko.observable(item.email);
    // item.enabled is a boolean value.
    this.enabled = ko.observable(item.enabled);
    this.credit = ko.observable(new Credit(item.credit));
    this.roles = ko.observableArray(item.roles);
  }    
  
  &lt;div data-bind='foreach: users'&gt;
    &lt;!-- This below prints 1 --&gt;
    &lt;span class='badge ' data-bind='text: enabled' &gt;&lt;/span&gt;
  
    &lt;!-- Both of those below don't activate (if check fails) --&gt;
    &lt;span class='badge badge-success' data-bind='if: enabled==1'&gt;OK&lt;/span&gt;
    &lt;span class='badge ' data-bind='if: enabled==0' &gt;NO&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>&lt;span class='badge badge-success' data-bind='if: enabled==1'&gt;OK&lt;/span&gt;
  &lt;span class='badge badge-success' data-bind='if: enabled'&gt;OK&lt;/span&gt;
  &lt;span class='badge badge-success' data-bind='if: enabled()'&gt;OK&lt;/span&gt;
  &lt;span class='badge badge-success' data-bind='if: enabled=="1"'&gt;OK&lt;/span&gt;
  </code></pre>
  
  <p>with no luck. What am i doing wrong?</p>