suman goud

suman goud

  • NA
  • 176
  • 51.2k

how to calculate result based on formula using angular

Mar 6 2017 2:08 AM

i have 3 input values A,B,C .if i give any expression in formula(like A+B+C or A+100,A*B,A+B+1500)on change event calculate result how to do this

A:<input type="text" ng-model="v.A" />
 B:<input type="text" ng-model="v.B" /> 
C:<input type="text" ng-model="v.C" /> <br />
 Formula:<input type="text" ng-model="v.Formula" ng-blur="CalculateFormula(v)" /> 
{{result}}

Angular script

//on change of formula 
 $scope.CalculateFormula = function (v) { // }

can you please suggest how can i do this


Answers (1)