It's a simple idea, an angular directive that let's you lazy load images.
Requirements: AngularJS 1.2+
File Size: 1.1Kb minified
You can install it via bower
$ bower install sr-lazy-load
- Include the module as a dependency for your app
angular.module('myApp', ['sinrutina.lazyload'])
- 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.
- 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
Inspiration taken from jquery.lazyload
Licensed under the MIT license