1๐
โ
I believe the problem is that you are passing new Object()
to your editItem
method. Iโm assuming that you assign that value SelectedUnit
in that method, which is causing the error.
The problem is that this sets the nested object address
to undefined. So when you try and read addressLine1
from an undefined object, it will throw an error.
I suggest setting SelectedUnit
to a blank version of itself inside the edit method. Something like this.
this.SelectedUnit = {
address: {
addressLine1: '',
...
},
bedrooms: '',
...
}
๐คjrend
Source:stackexchange.com