angularjs如何删除一个元素内的对象从 ng-repeat 吗
1个回答
2016-08-23
展开全部
我试图从对象中删除几个元素,但我得到错误,此对象是里面的 ng-repeat 。
错误︰ 不允许重复直放站的。使用 '跟踪' 表达式来指定唯一的密钥。直放站 ︰ 子元素在 parent.beneficiaries,重复键 ︰ 未定义 ︰ 未定义,重复值 ︰ 未定义
我做了一个简单 W2C9ML4dEgJzqj6JeqWC?p=preview
我的控制器 ︰
angular
.module("myApp", [])
.controller("myCtrl", myCtrl);
function myCtrl(){
var vm = this;
vm.classification = [
{
"name": "Favoritos",
"beneficiaries":[
{
"idE": "1",
"type": "Beneficiarios",
"name": "Alexander Bueno",
"selected": false
},
{
"idE": "2",
"type": "Beneficiarios",
"name": "Lorena Torrealba",
"selected": false
},
{
"idE": "3",
"type": "Beneficiarios",
"name": "Fabián Pernía",
"selected": false
}
]
},
{
"name": "Mis cuentas",
"beneficiaries":[
{
"idE": "8",
"type": "Cuentas",
"name": "Corriente ...1234",
"selected": false
},
{
"idE": "9",
"type": "Cuentas",
"name": "Corriente ...9854",
"selected": false
},
{
"idE": "10",
"type": "Cuentas",
"name": "Ahorro ...9921",
"selected": false
}
]
},
{
"name": "Terceros",
"beneficiaries":[
{
"idE": "4",
"type": "Beneficiarios",
"name": "Alexander Ramírez",
"selected": false
},
{
"idE": "5",
"type": "Beneficiarios",
"name": "Vicente Delgado",
"selected": false
},
{
"idE": "6",
"type": "Beneficiarios",
"name": "Alexis Rodríguez",
"selected": false
},
{
"idE": "7",
"type": "Beneficiarios",
"name": "Ignacio Bueno",
"selected": false
}
错误︰ 不允许重复直放站的。使用 '跟踪' 表达式来指定唯一的密钥。直放站 ︰ 子元素在 parent.beneficiaries,重复键 ︰ 未定义 ︰ 未定义,重复值 ︰ 未定义
我做了一个简单 W2C9ML4dEgJzqj6JeqWC?p=preview
我的控制器 ︰
angular
.module("myApp", [])
.controller("myCtrl", myCtrl);
function myCtrl(){
var vm = this;
vm.classification = [
{
"name": "Favoritos",
"beneficiaries":[
{
"idE": "1",
"type": "Beneficiarios",
"name": "Alexander Bueno",
"selected": false
},
{
"idE": "2",
"type": "Beneficiarios",
"name": "Lorena Torrealba",
"selected": false
},
{
"idE": "3",
"type": "Beneficiarios",
"name": "Fabián Pernía",
"selected": false
}
]
},
{
"name": "Mis cuentas",
"beneficiaries":[
{
"idE": "8",
"type": "Cuentas",
"name": "Corriente ...1234",
"selected": false
},
{
"idE": "9",
"type": "Cuentas",
"name": "Corriente ...9854",
"selected": false
},
{
"idE": "10",
"type": "Cuentas",
"name": "Ahorro ...9921",
"selected": false
}
]
},
{
"name": "Terceros",
"beneficiaries":[
{
"idE": "4",
"type": "Beneficiarios",
"name": "Alexander Ramírez",
"selected": false
},
{
"idE": "5",
"type": "Beneficiarios",
"name": "Vicente Delgado",
"selected": false
},
{
"idE": "6",
"type": "Beneficiarios",
"name": "Alexis Rodríguez",
"selected": false
},
{
"idE": "7",
"type": "Beneficiarios",
"name": "Ignacio Bueno",
"selected": false
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询