I am trying to change the ID property of my currentUrl object within my component. My goal is for the ID to update and then fetch the corresponding data based on that ID. However, I keep encountering this error message:
"Cannot assign to read only property 'id' of object '[object Object]'"
Does anyone have any suggestions on how to resolve this issue?
addBranch(id){
this.currentUrl = this.activatedRoute.snapshot.params;
console.log(this.currentUrl.id); // Currently the id is undefined
this.currentUrl.id = id; //Cannot assign to read only property 'id' of object '[object Object]'
window.location.reload();
}