Load placeholder image on image error
Angular 2 directive that loads placeholder image on primary image error.
npm install ng2-img-fallback --save
In case you're using
SystemJS see configuration here
Add module to your module's
Use it in you component
(loaded) event which is fired when either
src-fallback is loaded.
To determinate whether original source or fallback is loaded - add a param to your callback for the
First add callback to your component
and then bind it to the