Skip to content

Instantly share code, notes, and snippets.

@webcat12345
Last active November 10, 2017 08:20
Show Gist options
  • Save webcat12345/9fc78178f40e89327694d0d951176363 to your computer and use it in GitHub Desktop.
Save webcat12345/9fc78178f40e89327694d0d951176363 to your computer and use it in GitHub Desktop.
Display placeholder image if url is invalid
This is way is very simple and nice way to display images in Angular.
<img [src]="imageUrl" class="img-responsive" onError="this.src='assets/images/no-image.png';">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment