Fallback image source directive
JavaScript Vim script Shell
Latest commit b655e80 Jun 17, 2014 @tlvince Ignore dev files in bower
Permalink
Failed to load latest commit information.
scripts
test
.bowerrc
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
.vimrc
bower.json
fallback-src.js
package.json
readme.md

readme.md

angular-fallback-src

Build status

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.

Install

bower install angular-fallback-src

Usage

Add fallback.src as a module dependency, e.g.:

angular.module('App', ['fallback.src']);

Author

© 2014 Tom Vincent http://tlvince.com/contact

License

Released under the MIT License.