var selPage2 = $scope.selPage + $scope.itemsPerPage;
$scope.selPageUp = selPage2;
for example if value of selPage is 50 and value of itemsPerPage is 10 and I want to display my value in HTML element like
{{selPageUp}}
Angular JS will make connection of this two strings and will display it like 5010, but I want to sum up two values to display number 60. How to do that? Example if I change operator from + to * it will multiply value and display 500 it will work on way I want. Help please?
If they are integers:
var selPage2 = parseInt($scope.selPage) + parseInt($scope.itemsPerPage);
Otherwise:
var selPage2 = parseFloat($scope.selPage) + parseFloat($scope.itemsPerPage);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With