How to get the result of adding two number in third text box

Nov 13 2017 1:31 AM
It is not at al giving the result. Help me to find where I was wrong
 
View:
@{
ViewBag.Title = "Home Page";
}
<script src="scripts/angular.min.js"></script>
<script src="~/Scripts/AngularJsDemo.js"></script>
<div ng-app="MyFinancialsApp">
<div ng-controller="MyController">
<div >
GrossWanges: <input ng-model="a" type="text" ng-change="UpdateVal()"/>
</div>
<div>
OverTime : <input ng-model="b" type="text" ng-change="UpdateVal()" />
</div>
<div>
ChildSupport : <input ng-model="c" type="text" ng-change="UpdateVal()" />
</div>
<div style="float:right">
<p>Total : {{a--b--c}}</p>
</div>
</div>
</div>
 
 
AngularJs:
var FinancialsApp = angular.module("MyFinancialsApp", [])
.controller("MyController",function($scope)){
$scope.UpdateVal=function(){
$scope.TotalVaue=($scope.a)+($scope.b)+($scope.c);
}
});
 
 

Answers (6)