AngularJS:单击按钮时添加多行下拉列表和文本框

时间:2018-10-15 06:30:51

标签: html angularjs

我需要在每行下方提供一个按钮,单击该按钮需要添加一个新行。我可以这样做,但是问题是我没有得到列表中的项目。这是标记:

<div class="form-group">
    <label class="col-sm-3">Categories</label>
    <div class="col-sm-9">
        <select ng-change="getCategories()" chosen ng-model="clientCategories" class="form-control" options="clientCategories" data-placeholder="-Select-" ng- ng-options="o as o.categoryName for o in clientCategories track by o.categoryId"></select>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3">Sub-Category</label>
    <div class="col-sm-9">
        <input id="subCategory" name="subCategory" type="text" ng-model="subCategory" class="form-control">
    </div>
</div>

上面的代码给了我一行绑定列表的地方。我需要的是使用相同的控件单击“添加行”并使用“删除”按钮为每一行列出值并在提交用户选择并输入的所有类别和子类别时添加多行。有人可以帮忙上面的代码吗?

0 个答案:

没有答案
相关问题