angular-img-fallback

WebJar for angular-img-fallback

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-img-fallback
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-img-fallback
WebJar for angular-img-fallback
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dcohenb/angular-img-fallback

Download angular-img-fallback

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-img-fallback/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-img-fallback</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-img-fallback/
implementation 'org.webjars.bower:angular-img-fallback:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-img-fallback/
implementation ("org.webjars.bower:angular-img-fallback:0.2.0")
'org.webjars.bower:angular-img-fallback:jar:0.2.0'
<dependency org="org.webjars.bower" name="angular-img-fallback" rev="0.2.0">
  <artifact name="angular-img-fallback" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-img-fallback', version='0.2.0')
)
libraryDependencies += "org.webjars.bower" % "angular-img-fallback" % "0.2.0"
[org.webjars.bower/angular-img-fallback "0.2.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Angular Image Fallback

Angular directives that handles image loading, it has fallback-src to handle errors in image loading and loading-src for placeholder while the image is being loaded.

Bower Download

bower install angular-img-fallback

Installation

  1. Download and import the plugin script.
    <script src="lib/angular-img-fallback/angular.dcb-img-fallback.min.js"></script>
  2. Add dcbImgFallback to your angular app module dependencies list.
    angular.module('myAngularApp', ['dcbImgFallback']);
  3. Add the fallback-src attribute to your img
    <img ng-src="{{'path/to/img.jpg'}}" fallback-src />

Usage

Just add the fallback-src and the loading-src attributes to your <img /> tags
<img ng-src="{{'path/to/img.jpg'}}" fallback-src loading-src />
Make sure you use ng-src as your image src attribute.

Advanced options

  • Simple usage, will replace to a default missing image placeholder
    <img ng-src="{{'path/to/img.jpg'}}" fallback-src />

  • Custom fallback, will replace to your own custom missing image
    <img ng-src="{{'path/to/img.jpg'}}" fallback-src="{{'path/to/fallback.jpg'}}" />

  • Loading placeholder, show a loading placeholder until image loads
    <img ng-src="{{'path/to/img.jpg'}}" loading-src />

  • Custom Loading placeholder, show a custom image loading placeholder until image loads
    <img ng-src="{{'path/to/img.jpg'}}" loading-src="{{'path/to/loading.jpg'}}" />

  • Or both! loading placeholder and a fallback source can work together
    <img ng-src="{{'path/to/img.jpg'}}" loading-src fallback-src />

Icons license

Icons are provided from http://icomoon.io/ under the GNU General Public License v3.0
http://www.gnu.org/licenses/gpl.html

Contributing

We use Babel to compile the es6 code to es5 and uglify-js to minify the code even more. it's already setup, all you need to do is install dependencies using $ npm install and run $ npm run build.

Versions

Version
0.2.0
0.1.4