Fallback image source directive
Add an fb-src
attribute to an <img>
. If the image's ng-src
does not
exist, fb-src
will be used instead.
Example:
<img
ng-src="broken.png"
fb-src="http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png" />
fb-src
can of type array of strings, in which case, each element will be
used in turn until a request is successful.
bower install angular-fallback-src
Add fallback.src
as a module dependency, e.g.:
angular.module('App', ['fallback.src']);
© 2014 Tom Vincent http://tlvince.com/contact
Released under the MIT License.