你好家伙我试图清除我的ng模型,当我启动我的更改功能,但我的问题是我不想删除所有我想排除对象中的一个项目。不包括对象角度ng变化
function change() {
if (vm.location.type) {
angular.forEach(vm.location, function (value, index) {
delete vm.location;
});
}
}
,所以我不想删除
vm.location.type
我
vm.location
有
vm.location.boundaries;
vm.location.region;
vm.location.address;
vm.location.name;
vm.location.nonVisitingRadius;
vm.location.visitingRadius;
我不确定,你正在尝试,但如果你想从对象中删除一个键,然后尝试像这样:'vm.location.region;' –
我想要做的是我想删除所有vm.location,但我不想删除vm.location.type,因为我仍然需要它 –