angular2-imagelazyload-directive
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15042
40