I'm trying to add two numbers in my application. One number is from database and other I want to insert in the application. It is very simple but I'm new to angularjs. This is my code:
Html :
<div class="item-input-inset">
<label class="item-input-wrapper">
<input type="number" placeholder="Insert Points" ng-model="inp"/>
</label>
</div>
<span> {{sum()}} </span>app.js
app.js
.controller('AppCtrl', function($scope, PointService) {
$scope.points = 0;
$scope.inp = 0;
$scope.sum = function(){
return $scope.points + $scope.inp }
All the app display is number 9 which is $scope.points as in my database it is 9 but it doesn't add the input number when I try to input any number. Anyone could please help?
I made a working demo based on your code and it seems to be working fine.