The method called getDetails()
retrieves an array of Details[]
. Within this array, there is a property named name which I need to pass to another HTTP request.
Details {
name: String;
Details
getDetails()
return this.https.get("/someValue")
return
{name : hello}
Information
getInformations(name:string) {
return this.https.get("/anotherValue"+"?"+ name)
}
I am attempting to first call the getDetails()
method and then pass the extracted name property to
Information{
Hieght:string
age:string
}
getInformations()
this.getDetails().pipe(mergeMap(x =>
this.getInformations(x.name)).subscribe((inforamtionResults:Information[])=>{
console.log("Checking Informations"+inforamtionResults.length)
return
{height:160,
age: 23
}
This approach is not functioning properly as the value of x is an array. How can I iterate over the array and pass each item's property as a parameter?