Editable List in Angularjs -
i create list user can not edit individual steps, edit number of steps well. how can in angularjs?
the problem i'm having if use ng-model in "ol" don't think can create list of individual elements, if use ng-repeat in "li" don't think can add new elements list. what's best way solve this?
you can this:
js:
$scope.range = function(min, max, step) { step = step || 1; var input = []; (var = min; <= max; += step) { input.push(i); } return input; } $scope.list = []; $scope.printlist = function(){ console.log($scope.list); }
html:
<input type="number" ng-click="printlist()" ng-model="len"> <ol> <li ng-repeat="n in range(0,len-1)"><input type="text" ng-model="list[n]"></li> </ol>
Comments
Post a Comment