Hello I have created a button for add element in a list, but it add only one object, how can i do for add each object for each click on button ?
this is HTML
<body >
<div ng-controller="myControl">
<ul>
<li ng-repeat="x in products">{{x}}
<button ng-click="removeEle($index)"> X </button>
</li>
</ul>
<button ng-click="addEle()"> add</button>
</div>
and this is js
var app = angular.module('myClick', []);
app.controller('myControl', ['$scope', function($scope){
$scope.products=['one','two','three'];
$scope.addEle= function(){
$scope.products.push($scope.add);
}
$scope.removeEle =function(x){
$scope.products.splice(x,1);
}
}]);
thanks for help