Create in your controller a function that calculate your formulas, and then
call that function on value change of Num1 input.
Here it is an example: https://plnkr.co/edit/V8T3ZEOnGCEteDhjjm2Z?p=preview
NB: *ng-model-options="{debouce:500}" *is just a best practice: it ensure
that the function is called 500ms after the user stop writing on the input,
to ensure unnecessary calculations during user interaction.
Bye bye
2016-08-13 1:33 GMT+02:00 tony stark <[email protected]>:
> Hello again, members of the Angular Technorati. I come with a simple math
> formula issue. Can someone enlighten me as to how to create math formulas
> with multiple operators for my Finance calculator. Here is the math formula
> i need to create:
>
> ( Amount x interest(0.05) ) + Amount = total Amount due after financing
>
> <body ng-app="" class="container">
>
> <br />
>
> <div class="row">
>
> <LABEL>INITIAL AMOUNT:</LABEL>
> <input type="number" ng-model="Num1" class="input" /><br />
>
> <LABEL>FINANCE CHARGE:</LABEL>
> <input readonly="readonly" type="text" ng-model="Num2" value="{{Num1
> * 0.05}}" class="input" /><br />
>
> <LABEL>FINANCED SUBTOTAL:</LABEL>
> <input readonly="readonly" type="text" ng-model="Num3" value="{{Num1
> + Num2}}" class="input" /><br />
>
> </div>
>
>
>
> What is the proper angularjs syntax for this formula?
>
> Thanks in advance,
> Batoe
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.