I have been trying to get data from my webservice into an array of my custom type (both models match, I have checked that)
The object itself people is defined and initialised as a black array of type Person.
However when making the subscribe call the array is now undefined.
This was working, I'm not actually sure why it stopped
Declaration
people: Person[] = [];
Subscription
getPeople() {
this.isLoading$.next(true);
this.PeopleService.GetAll().subscribe(
o => {
if (o) {
this.people = o;
}
else {
this.people = [];
}
},
error => {
console.log(error);
},
() => {
this.isLoading$.next(false);
}
);
}
Before the method, this.people is defined as Array[0]
When in the getPeople method, this.people is undefined.
o is defined and has data.
UPDATE 1 10:41 2019/05/03
I noticed the following when debugging
could this be the cause, if so why? I've been writing all my methods like this and none have ever given me this issue

getPeoplemethod?this.getPeople()