Within one of my functions, I am encountering the following code:
this.personService.getPersonInfo(this.personId).subscribe((res => {
let response = res.body;
let num = response.personList.size;
...
}))
Here is what the expected structure of the response object should be:
export class Person {
personExists: boolean,
personList: Set<Address> = new Set<Address>();
}
Despite being able to see data in the response object during debugging, the value of the size of personList appears as undefined
.
This is what the data looks like during debugging:
response = {
personExists = true,
personList = Array(1)[Object]
-> 0 = Object{id: 1, name: Tony}
length = 1
}