You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ionic-tmdb for my studies and I found this situation:
When clicking on a Movie that doesn't have Trailers (videos on Youtube), the property 'results[0].key' are undefined.
This movie has no trailers yet, so I create this in 'movie-details.ts':
`...
videoResults(movie){
if (movie.videos.results.length > 0){
return true;
}
return false;
}
...`
And put a ngIf in 'movie-details.html':
`...
<ion-row *ngIf="videoResults(movie)">
...`
This works well for me.
Thanks for sharing your project
The text was updated successfully, but these errors were encountered:
saulobr88
changed the title
Sugestion: Check 'videos.results.length' before display in Template
Suggestion: Check 'videos.results.length' before display in Template
Oct 10, 2017
Hi,
I'm using ionic-tmdb for my studies and I found this situation:
When clicking on a Movie that doesn't have Trailers (videos on Youtube), the property 'results[0].key' are undefined.
Example: https://api.themoviedb.org/3/movie/414906?api_key=3191a71fe91620589f637340f6a92180&append_to_response=videos
This movie has no trailers yet, so I create this in 'movie-details.ts':
`...
videoResults(movie){
if (movie.videos.results.length > 0){
}
return false;
}
...`
And put a ngIf in 'movie-details.html':
`...
<ion-row *ngIf="videoResults(movie)">
...`
This works well for me.
Thanks for sharing your project
The text was updated successfully, but these errors were encountered: