Skip to content

jvillarejo/sr-lazy-load

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sr-lazy-load

It's a simple idea, an angular directive that let's you lazy load images.

Requirements: AngularJS 1.2+

File Size: 1.1Kb minified

Install:

You can install it via bower

$ bower install sr-lazy-load

Usage:

  1. Include the module as a dependency for your app
angular.module('myApp', ['sinrutina.lazyload'])
  1. Add the directive to your image like this
<img sr-lazy-load="url" sr-spinner-class="spinner fa fa-spinner fa-spin">

Where url is your scope variable that has the referene to the src, internally it will get the value from the scope.

  1. The directive also adds an icon tag before the img tag in order to display a loading spinner, you can configure it's classes with sr-spinner-class

Credits:

Inspiration taken from jquery.lazyload

License:

Licensed under the MIT license

About

An Angular directive for lazy loading images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published