Being new in angular js ,just trying some basic example & came across this issue.
I am creating a table using ng-repeat
where a json array
is the data source. The table has a quantity column and an add button.
I want to increase the value of quantity once I click on the add button.By understanding is since it is a two way data binding if I increase the value bind to ng-model
it will reflect in the view, which is not happening
JS
angular.module('DemoApp',[]).controller('TableController',['$scope',function($scope){
$scope.dataset = [json data ];
$scope.add = function($event){
// get $scope.bookQuantity,add 1
var _m =$scope.bookQuantity;
console.log(_m) // consoling undefined;
}
}])
I followed this link but still not able to resolve the issue.
I have created this Plunker which may help to understand the problem.