JSFiddle - React, Tailwind, and code Playground
by scriptstar
HTML
<div ng-app="myApp" ng-controller="MyCtrl">
[<span ng-repeat="input in inputs">"{{input.field}}"</span>]:
[<span ng-repeat="input in inputs">"{{input.value}}"</span>]
<div ng-repeat="input in inputs">
<input type="text" ng-model="input.field" />
<input type="text" ng-model="input.value" />
<button ng-click="removeInput($index)">Remove</button>
</div>
<button ng-click="addInput()">add input</button>
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('MyCtrl', ['$scope', function ($scope) {
$scope.inputs = [];
$scope.addInput = function(){
$scope.inputs.push({field:'', value:''});
}
$scope.removeInput = function(index){
$scope.inputs.splice(index,1);
}
}]);