title: AngularJS Expression From a String
body: <p>Note: Similar to: <a href="https://stackoverflow.com/questions/18672034/angularjs-execute-expression-from-variable">angularjs execute expression from variable</a> except I don't want to clutter up my scope with all the possibilities and data sets in use.</p>
  
  <p>I want to be able to utilize pre-determined formulas in Angular's expressions.</p>
  
  <p>Example:</p>
  
  <pre><code>  var config = {
      "Test": {
        name: "test",
        formula: true,
        formulaValue: "item['propertyOne'] + item['propertyTwo']"
      }
    }
  
  &lt;div ng-repeat="item in myArray"&gt;
    &lt;span ng-if="config[item.name].formula"&gt;{{config[item.name].formulaValue}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Where the formula in <code>formulaValue</code> gets evaluated as if I typed it like:</p>
  
  <pre><code>&lt;div ng-repeat="item in myArray"&gt;
    &lt;span&gt;{{item['propertyOne'] + item['propertyTwo']}}&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How would I accomplish this? It's not quite feasible to make a $scope function for each type of formula either, as these are setup in a config in fairly large quantities.</p>