Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-imagelazyload-directive

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-imagelazyload-directive - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

index.js

@@ -9,3 +9,3 @@ "use strict";

this.fadeIn = true;
this.fadeInDuration = 1;
this.fadeInDuration = 1000;
}

@@ -12,0 +12,0 @@ /**

{
"name": "angular2-imagelazyload-directive",
"version": "1.0.0",
"version": "1.1.0",
"description": "Angular 2 Image Lazy Load Directive",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,1 +0,39 @@

# angular2-imagelazyload-directive
# angular2-imagelazyload-directive
[![npm version](https://badge.fury.io/js/angular2-imagelazyload-directive.svg)](https://badge.fury.io/js/angular2-clickoutside-directive)
[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
## Install
`npm i angular2-imagelazyload-directive --save`
### Import the directive to your project and use it in your images specifing a `data-src`, `width` and `height`
```typescript
import { ImageLazyLoadDirective } from 'angular2-imagelazyload-directive';
@Component({
selector: 'my-app',
template : `
<img height="200" width="200" imagelazyload threshold="300" ></img>`,
directives : [ ImageLazyLoadDirective ]
} )
class MyFirstComponent implements OnInit {
constructor(){}
ngOnInit(){}
}
```
By default the directive has a 300px threshold, meaning the image will be loaded 300px before it became visible in the viewport. You can change that by passing a threshold attribute to your `img` tag.
Also by default the images are fading-in in a duration of 1000ms, you can disable that with the `fadeIn` attribute or specify the duration using the `fadeInDuration` (default 1000ms)
### Contribute
Any pull-request is more than welcome :boom: :smile:
This project adheres to the Contributor Covenant [code of conduct](http://contributor-covenant.org/). By participating, you are expected to uphold this code.
### License
MIT

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc