title: How to assign Boolean value to model
body: <p>I have the following view with two input radio buttons:</p>
  
  <pre><code>&lt;label&gt;
      &lt;input type="radio" name="test" ng-model="fooBar" 
          value="true" ng-change="logConsole()"&gt;
      True
  &lt;/label&gt;
  
  &lt;label&gt;
      &lt;input type="radio" name="test" ng-model="fooBar" 
          value="false" ng-change="logConsole()"&gt;
      False
  &lt;/label&gt;
  </code></pre>
  
  <p>And my controller looks like:</p>
  
  <pre><code>//Initialization
  $scope.fooBar = false;
  
  $scope.logConsole = function () {
      console.log("Value is : " + $scope.fooBar);
      console.log("Type is : " + typeof $scope.fooBar); //Always displays 'string'
  };
  </code></pre>
  
  <p>My problem is that when the user selects either of the radio buttons, the type of the <code>fooBar</code> model is always a String, that is the value is either the String 'true' or the String 'false' - I want the type to be a boolean true value or a boolean false value.
  How can I store a boolean value (from within the view) onto the model?</p>
  
  <p>EDIT: I just tried this out and it still does not work. For the <code>value</code> attribute, I passed a function that would return boolean true or false, something like this:</p>
  
  <pre><code>&lt;input type="text" value="{{getBoolean('true')}}....&gt;
  </code></pre>
  
  <p>$scope.getBoolean = function (value) {
      if (value === 'true') return true;
      else return false;
  };</p>
  
  <p>It still results in a String when the radio buttons are selected...</p>