This is my controller:
$scope.inputs = [];
$scope.addInput = function () {
$scope.inputs.push({
id: $scope.inputs.length + 1,
});
};
$scope.removeInput = function (index) {
$scope.inputs.splice(index, 1);
};
I try this way but didn't work:
<div ng-repeat="input in inputs">
<textarea id="activity"
name="project_budget_administration[<% input.id %>][activity]"
placeholder="Activity"
ng-model="project_budget_administration.activity_<% input.id %>"
ng-maxlength="100"
required></textarea>
</div>
For name attribute of textarea works perfect but for ng-model - not. Also i tried with this syntax ng-model="project_budget_administration.activity[input.id]" and instead of input.id i tried $index, also not working.