This is my function which i define in my service and i am calling this service method in my component but it return before the response has come from http api call, so i get undefined return data.
home(){
this._http
.post("http://localhost:3000/home", {
email: JSON.parse(this.cookieService.get("token")).email
})
.subscribe(data => {
this.result = JSON.parse(data["_body"]);
console.log(this.result);
send=>{return this.result}
})
}