I am using an Apirest and I have configured a .service file in Angular with Observables.
I need to get the value that the subscribe returns to be able to return it with a return but it always throws the return before I finish the http.service
getIdMyDirector(centroMiDirector): number {
this.userService.getIdMiDirector("miDirector", centroMiDirector).subscribe(
idDirectorHttp => { this.idDirector = idDirectorHttp; }
);
return this.idDirector;
}