hello , I have this table , the last row calculate the sum of the rows
before using angularjs , and i need to compare the Two sums calculated , and
I want the result to be displayed at the bottom of the table in <div
id="result"> <div>
this is the html code :
<table ng-controller="Todosomme" ><tr ><td > <input type="number"
ng-model="som1" /> </td><td ><input type="number" ng-model="som2" /> </td>
</tr>
<tr ><td > <input type="number" ng-model="som3" /> </td><td ><input
type="number" ng-model="som4" /> </td> </tr>
<tr ><td > <input type="number" ng-model="som5" /> </td><td ><input
type="number" ng-model="som6" /> </td> </tr>
<tr > <td > <input type="number" value="{{totalsom1()}}" /> </td>
<td ><input type="number" value="{{totalsom2()}}" /> </td></tr>
</table>
and this is the javascript code :
<script type="text/javascript">
function Todosomme($scope) {
$scope.totalsom1 = function () {
var x=parseInt($scope.som1+$scope.som3+$scope.som5);
return (x);
};
$scope.totalsom2 = function () {
var y=parseInt($scope.som2+$scope.som4+$scope.som6);
return (y);
};
}
</script>
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.