I am attempting to save the value from an observable into a variable within the component by utilizing a service. However, the variable always ends up as undefined. When I check "names" inside the subscribe function, it does contain the expected value.
this.dataClient.obsNames.subscribe(names => {
this.names = names; //initialized as public names = [];
});