Looking to convert an expression into JavaScript in order to maintain an object's value in $scope
:
<dl class = "mortgage-information">
<dt><abbr title = "Loan-to-value Ratio">LTV</abbr></dt>
<dd>{{(total_financing ? total_financing : financing)/ property_value}}</dd>
</dl>
However, when converting the same expression to JavaScript, it always uses financing
and not total_financing
(Coffeescript):
$scope.ltv = (if $scope.total_financing then $scope.total_financing else $scope.financing) / $scope.property_value
Despite reading through the documentation on angular expressions, I haven't found a satisfactory solution. Any recommendations for a smoother transition of expressions to JavaScript?