How can I retrieve images from an API and properly access the specific object within the object? Any tips would be greatly appreciated!
API Endpoint:
This is how my interface is structured:
export interface MovieModel {
id: number;
name: string;
summary: string;
images: Images[];
type: string;
status: string;
url: string;
genres: { [key: string]: Genres};
}
export interface Images{
medium: string;
original: string;
}
export interface Genres{
g: string[];
}
This is how I am calling the API:
this.http.get(this.apiKey).subscribe((data: MovieModel[]) =>{
console.log(data);
this.Movies = data;
In my HTML, I have:
<ion-card-title>
{{movie.name}}
</ion-card-title>
<ion-img src="{{movie.images}}"></ion-img>
If you have any suggestions on how to successfully retrieve and display images, please share. Thank you!