dev*_*qon 7

只需使用输入定义一个数组,然后循环显示它们:

$scope.inputs = [
    { value: null }
];

$scope.addInput = function () {
    $scope.inputs.push({ value: null });
}

$scope.removeInput = function (index) {
    $scope.inputs.splice(index, 1);
}
Run Code Online (Sandbox Code Playgroud)

在你看来:

<div ng-repeat="input in inputs">
    <input type="text"
           ng-model="input.value" />
    <button ng-if="$index == inputs.length - 1" 
            ng-click="addInput()">+</button>
    <button ng-if="$index != inputs.length - 1"
            ng-click="removeInput($index)">-</button>
</div>
Run Code Online (Sandbox Code Playgroud)

看到这个jsfiddle