I am getting the data from my web service and storing the same data into my scope variable like
then(function (Tlist) {
$scope.Tlist=Tlist.data;
})
and displaying the same data into table, now in my table i am selecting the row by checkbox like
<td>
<input type="checkbox" ng-checked="checkall" ng-model="Ldata.checked" data-ng-click="calculateTotal(Ldata)" />
</td>
and in my "calculateTotal(Ldata)" function i want to store the value of (Ldata.amount) into another $scope variable
this is how my condition inside the function looks
if (Ldata.checked) {
$scope.total += Number(Ldata.amount);
console.log(Ldata.amount);
console.log(Number($scope.total));
}
but on
console.log(Number($scope.total));
line my result is coming as NaN but on this line and on console.log(Ldata.amount); this line my result is coming as 1400 so i am not able to understand why i am unable to pass data from one variable to another
$scope.totalwhen you start here? What doesconsole.log($scope.total);output? It seems like$scope.totalisn't a legal number...