Skip to content

Image directive to show image or hide image or replace image with other image depending on width / height specified.

Notifications You must be signed in to change notification settings

AnkushD/epic-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

epic-image

This is a image directive to handle broken images (image broken link).

Depending on what options you provide, broken image

  • will be removed
  • will be replaced with default image

If the image is not broken and width / height is specified, even then above actions can be taken.

##Installation

  1. Include the directive in your code
    1. Use bower bower install epic-image or
    2. Install from npm npm install epic-image
  2. If your JavaScript file is not generated from dependencies,
    then you must include it in your HTML <script src='epic-image.js'></script>
  3. Add to app dependencies:
```javascript var app = angular.module("app", ["epic-image"]); ```

Usage:

Image as a background

As block element (e.g <div>)
@params
actual-image    - external image url (NOT IN {{ }});
default-image   - image to show when actual-image url not working 
                  if not specified then element will be removed from DOM;
min-image-width - if not specified then will allow any size image
                  value should be without 'px';

HTML Syntax:
<div checkbackground default-image="static_link" actual-image="dynamic_link" min-image-width="100"></div>

Image as src

As image tag (e.g <img src=''>)
@params
actual-image    - external image url (NOT IN {{ }});
default-image   - image to show when actual-image url not working 
                  if not specified then element will be removed from DOM;
min-image-width - if not specified then will allow any size image
                  value should be without 'px';

How to use:
<img checksrc default-image="static_link" actual-image="dynamic_link" min-image-width="100" />

About

Image directive to show image or hide image or replace image with other image depending on width / height specified.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published