[英]How to delete a particular row properly using Angular.js/Javascript
i need one help.I need to remove a particular row from a table using Angular.js .Here i have +
and -
button implementation.I have all my code inside https://plnkr.co/edit/D3UrDYwiglMKQyCW0wvW?p=preview 我需要一个帮助。我需要使用Angular.js从表中删除特定行。这里我有
+
和-
按钮实现。我将所有代码都放在https://plnkr.co/edit/D3UrDYwiglMKQyCW0wvW?p=preview中
From the Plunkr suppose for Monday i did 3 entries using +
button.when i am deleting the middle(second) row using -
button this is deleting but it doing null to the 3rd row subcategory field and also displaying the different subcategory which is not belongs to that row category part.Here i need when user will delete any row that row value will delete not other row.All codes are present inside plunkr .Please help me. 在周一的Plunkr中,我使用
+
按钮进行了3次输入。当我使用-
按钮删除中间(第二条)行时,这正在删除,但它对第三行子类别字段执行了null,并且还显示了不属于的其他子类别到该行类别的一部分。在这里我需要用户何时删除任何行,该行值将删除其他行。所有代码都存在于plunkr中 。请帮助我。
I forked your plunker here 我在这里分叉了你的朋克
Some of the changes: 一些变化:
Controller : 控制器 :
$scope.listOfSubCategory = [{
id: 1,
name: 'SubCategory 1',
value: 1,
category: 1
}, {
id: 2,
name: 'SubCategory 2',
value: 2,
category: 2
}, {
id: 3,
name: 'SubCategory 3',
value: 3,
category: 3
}, {
id: 4,
name: 'SubCategory 4',
value: 4,
category: 4
}];
HTML 的HTML
ng-options="sub.name for sub in listOfSubCategory | filter:{ category: answer.category.id}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.