Goal: Load an image with a dynamic source. If no image is found, then load a placeholder image instead.
This should demonstrate what I\'m trying to
I Just did this :
In my HTML FILE wrote this
I called a function that is in my component.ts and pass the object wheres my url as a parameter
getImage(result){
if(result.poster_path){
return this.imageURL+(result.poster_path);
}else return "./assets/noFound.jpg"
Heres my function , first I verify if the object image url is different from null if is true then I return the image url else i return my default "noFound" image that is in my app assets.
Hope it helps!