title: How to call factory methods from HTML in angularjs?
body: <p>In <code>controller</code> I have followed methods:</p>
  
  <pre><code>var isPaused  = false; 
  
  $scope.switcher = function (booleanExpr, trueValue, falseValue) {
      return booleanExpr ? trueValue : falseValue;
  };
  
  $scope.isPaused = function () {
      return isPaused;
  };
  </code></pre>
  
  <p>And I can call it from HTML like:</p>
  
  <pre><code>&lt;body  ng-controller="Cntrl"&gt;
  
  ...
  &lt;h4&gt;
   {{ switcher( isPaused(), 'Search Address Mode', 'Search Location Mode' )}}
  &lt;/h4&gt;
   &lt;div class="btn-group"&gt;
      ...     
   &lt;/div&gt;
  </code></pre>
  
  <p>As you see if <code>isPaused()</code> returns <code>false</code> I get <code>&lt;h4&gt;Search Location Mode&lt;/h4&gt;</code></p>
  
  <p>This is utility therefore I want to define it as <code>factory</code></p>
  
  <pre><code>feederliteModule.factory('switcher', function () {   
  return {
      sw: function (booleanExpr, trueValue, falseValue) {
          return booleanExpr ? trueValue : falseValue;  
      }
    };
  });
  </code></pre>
  
  <p>No exceptions but </p>
  
  <p>when I try to call it like:</p>
  
  <pre><code>&lt;h4&gt;
   {{ switcher.sw( isPaused(), 'Search Address Mode', 'Search Location Mode' )}}
  &lt;/h4&gt;
   &lt;div class="btn-group"&gt;
      ...     
   &lt;/div&gt;
  </code></pre>
  
  <p>Nothing happens.</p>
  
  <p>**I added <code>'switcher'</code> to controller.</p>
  
  <p>How can I call factory method from HTML?</p>
  
  <p>(*You welcome to change/edit my question if it seems not clear)</p>
  
  <p>Thank you,</p>