I am new to Angular and currently working on an application that utilizes the typeahead functionality. I have set up a HTTP call through my Express backend on GCP to fetch search results from the TMDB database based on a search keyword.
this.http
.get<any>('https://hw8-308202.wl.r.appspot.com/search?search='+term).pipe(
map(data => data
))
.subscribe(data => console.log(data));
After making the call, I receive a response like this -
[
{
"id": 10255,
"backdrop_path": "NA",
"media_type": "movie",
"title": "Ab-normal Beauty"
},
{
"id": 1320678,
"backdrop_path": "NA",
"media_type": "person",
"title": "NA"
},
{
"id": 131563,
"backdrop_path": "NA",
"media_type": "person",
"title": "NA"
},
{
"id": 259172,
"backdrop_path": "/iZfCRsA9wcTZ0yWsuhXSHe4krdy.jpg",
"media_type": "movie",
"title": "Beyond the Great Wall"
},
{
"id": 115301,
"backdrop_path": "NA",
"media_type": "person",
"title": "NA"
},
{
"id": 107531,
"backdrop_path": "NA"
"media_type": "person",
"title": "NA"
},
{
"id": 1820070,
"backdrop_path": "NA",
"media_type": "person",
"title": "NA"
}
]
However, instead of iterating over each JSON object as expected, the entire response is being treated as a single iteration. I am struggling to extract only the title from each individual result. Any tips on how to achieve this?