Socket
Socket
Sign inDemoInstall

ngp-lazy-image

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngp-lazy-image

It is a directive developed in angular for the lazy loading of images


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

NgpLazyImage

It is a directive developed in angular for the lazy loading of images

Installation

npm i ngp-lazy-image --save

Usages

You must import the module NgpImageLazyLoadModule where you will use it.

***
import { NgpImageLazyLoadModule } from 'ngp-lazy-image';
@NgModule({
  ***
  imports: [
    NgpImageLazyLoadModule,
  ],
****
})

The ngp-lazy directive is placed on each img tag that requires lazy loading of the image:

<img ngp-lazy [src]="image.image" />

More configuration

You can change the detection threshold of the image and the opacity to load time to give a better transition to the user

<img
  src="https://images8.alphacoders.com/468/thumb-1920-468739.jpg"
  ngp-lazy
  ngp-threshold="0.1"
  ngp-opacity-duration="1.5s"
/>

More examples

Image Rating

Keywords

FAQs

Last updated on 19 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc