你好傢伙我試圖清除我的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,因爲我仍然需要它 –