Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

ngx-lazy-images

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-lazy-images

lazy loaded images with a small thumbnail, similar to Medium way of loading large images.

latest
Source
npmnpm
Version
1.5.0
Version published
Maintainers
1
Created
Source

Load images in background while showing a placeholder with a blurred thumbnail till the image is fully loaded (Optimize your page initial load time)

This library is under active development and hasn't yet reached its final form.

inspired by this Medium article

Compatibility

  • AOT
  • Jit
  • Custom Design Libraries (Material, ng-bootstrap, etc..)

Getting Started

Installation

npm i --save ngx-lazy-images

Import to App module

import { LazyImagesModule } from 'ngx-lazy-images';

@NgModule( {
	imports: [
		...
		LazyImagesModule,
	],
	...
} ) export class AppModule { }

Example Usage

Can be found at the demo page

API

  • largeImgUrl - the original heavy image url
  • thumbnailUrl - thumbnail url (200-500KB recommended)
  • styling - object containing styling properties for the large image eg. { 'border-radius': '12%'}

TODO

  • support for two way binding for the image url (in case the image can change due to a user event).
  • support for scroll events and detection of reaching the image elemnt to load
  • testing/travis

License

MIT

FAQs

Package last updated on 15 Apr 2018

Did you know?

Socket

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