I have some problem return
ing a string from my request.
getTest(id: string): string {
let foo: string = '';
this.service.testProfile(id).subscribe(
response => {
foo = response.body.foo;
},
error => {
console.log(error);
}
)
return foo;
}
I want to init foo
to my response. foo
and then just to return new value of foo. Everything work but there is no result, any idea what I'm doing wrong?
Thank