Greetings, I am currently working with an object structured like the following:
var obj= {
_id: string;
name: string;
loc: [{
locname: string;
locId: string;
locadd: [{
st: string;
zip: string;
}]
}]
}
Within TypeScript in Angular 2, my goal is to delete a specific row from this object.
deleterow(i, j) {
// i represents the index of loc
// j represents the index of locadd
this.obj.loc.splice(i, 1) // works correctly
this.obj.loc[i].locadd.splice(j, 1) // encountering issues as the row is not being removed without any error message.
}
I've attempted a solution similar to one provided in this answer on Stack Overflow, but it hasn't been successful.
If you have any insights on how I can successfully remove an item from locadd, I would greatly appreciate your assistance. Thank you.