epic-image

0.1.0 • Public • Published

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. Download latest release or
    2. Use bower bower install epic-image or
    3. 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" />

Readme

Keywords

none

Package Sidebar

Install

npm i epic-image

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • ankushd