angular2 onError image binding
It was almost complete he just forgot to change the image after the event.
errorHandler(event) {
console.debug(event);
event.target.src = "https://cdn.browshot.com/static/images/not-found.png";
}
Here is the link
component.ts
onImgError(event){
event.target.src = './assets/imgs/altImg.png'
//Do other stuff with the event.target
}
component.html
<img [src]="imgUrl" (error)="onImgError($event)">