Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Lazy Image

Just another lazy load image directive for AngularJS

The main goal of this directive is to show a way how we can implement the Medium progressive image loading.

Demo

Live demo on CodePen

Usage

Nothing new under the sun: typical module injection + adding the directive element to your html files.

Angular

  angular.module('app', [ 'ngLazyImage' ]);

HTML

Add <script>s to your code:

<script src="vendor/angular.min.js"></script>
<script src="build/angular.lazyimage.min.js"></script>

Add a lazy-image element to your html:

<div>
  <lazy-image width="400" height="200" source="/image/source.jpg" placeholder="/image/placeholder.jpg" />
</div>

Params

Param Type Required Default Details
source url Yes none The source image
placeholder url Yes none A tiny version of the source image
width integer No 300 The canvas width
height integer No 150 The canvas height

About

Implementation of the Medium progressive image loading

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages