The procedure of below code is to fetch email id from an api and resolve with details of that email id. I am in need to return the details directly as a response instead of needing to subscribe since I have just have this.route.snapshot.data.value assigned to a component and it takes data rightaway. Is there a way to achieve it? Please favour. I haven't written nested ones previously in resolve so , please guide. I just gave a try as below but it doesn't satisfy the need.
resolve() {
let info = environment.DETAIL_URL;
return this.appService.getInfo(info).pipe(map((res) => {
let user: any = res;
console.log(res);
let params: any = {};
params.personID = user.emailID;
return this.appService.getDataFromParams(environment.DATA_URL, params).pipe(map((res) => {
return res;
}))
}))
}
.pipe(map((res) => { return res; }))? It does absolutely nothing.