title: angularjs calculate expression and assign to model
body: <p>I have an expression in an ng-repeat that calculate various inputs in a table row and returns gross pay like so:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>App.controller 'calcPayCtrl', ($scope, $filter, Api, employments) -&gt;    
  
  active_employments = $filter('filter')(employments, {status: 'active'})
  $scope.employments = active_employments
  angular.forEach $scope.employments, (employment) -&gt;
      payslip = {employment_id: employment.id}
      employment.payslip = payslip
  </code></pre>
  
  <p><strong>VIEW</strong></p>
  
  <pre><code>&lt;td&gt;
     &lt;input ng-model="row.payslip.hours_worked"&gt;
     &lt;input ng-model="row.payslip.overtime_hours_worked"&gt;
  &lt;/td&gt;
  &lt;td&gt;
     &lt;h5&gt;Gross Pay&lt;/h5&gt;: {{ ((row.payslip.hours_worked*row.hourly_rate) || 0) + ((row.payslip.overtime_hours_worked*row.overtime_multiple) || 0 | currency: "" }}
  &lt;/td&gt;
  </code></pre>
  
  <p>The expression works as intended.</p>
  
  <p>Now I'd like to take the result of the gross pay and assign it to a $scope model so I can save it to a Rails Api like so</p>
  
  <pre><code>row.gross_pay = gross_pay
  </code></pre>
  
  <p>How do I assign the result of the expression to the model? </p>