I have a Observable that returns Data from an API. In this case there are 3 type of Addresses which could be returned, Office, Mailing and Home. But in the case user did not provide a Home Address that element does not exist in the API response.
i use
setInitialValue() {
this.userForm.setValue( {
home_address_city = this.userProfile.home_address.city
})
}
this works fine as long as that element exists. So i am wondering what is the safest way to handle this in case that this.userProfile.home_address.city does not exist