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

@trademe/ng-defer-load

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trademe/ng-defer-load - npm Package Compare versions

Comparing version 8.2.1 to 14.0.0

esm2020/defer-load.directive.mjs

8

defer-load.directive.d.ts
import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core';
import * as i0 from "@angular/core";
export declare class DeferLoadDirective implements OnInit, AfterViewInit, OnDestroy {

@@ -7,11 +8,8 @@ private _element;

preRender: boolean;
fallbackEnabled: boolean;
removeListenersAfterLoad: boolean;
deferLoad: EventEmitter<any>;
private _intersectionObserver?;
private _scrollSubscription?;
constructor(_element: ElementRef, _zone: NgZone, platformId: Object);
ngOnInit(): void;
ngAfterViewInit(): void;
hasCompatibleBrowser(): boolean;
ngOnDestroy(): void;

@@ -22,7 +20,7 @@ private registerIntersectionObserver;

private load;
private addScrollListeners;
private removeListeners;
private onScroll;
private isVisible;
private getScrollPosition;
static ɵfac: i0.ɵɵFactoryDeclaration<DeferLoadDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<DeferLoadDirective, "[deferLoad]", never, { "preRender": "preRender"; "removeListenersAfterLoad": "removeListenersAfterLoad"; }, { "deferLoad": "deferLoad"; }, never, never, false>;
}

@@ -0,2 +1,8 @@

import * as i0 from "@angular/core";
import * as i1 from "./defer-load.directive";
import * as i2 from "@angular/common";
export declare class DeferLoadModule {
static ɵfac: i0.ɵɵFactoryDeclaration<DeferLoadModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<DeferLoadModule, [typeof i1.DeferLoadDirective], [typeof i2.CommonModule], [typeof i1.DeferLoadDirective]>;
static ɵinj: i0.ɵɵInjectorDeclaration<DeferLoadModule>;
}
{
"$schema": "./node_modules/ng-packagr/package.schema.json",
"name": "@trademe/ng-defer-load",
"version": "8.2.1",
"version": "14.0.0",
"description": "Angular directive to load elements lazily",
"main": "bundles/trademe-ng-defer-load.umd.js",
"typings": "trademe-ng-defer-load.d.ts",
"author": "Vamsi Vempati, Michael Zoellner",
"main": "dist/index.js",
"typings": "index.d.ts",
"author": "Vamsi Vempati, Michael Zoellner, Nick Webster",
"license": "MIT",

@@ -23,32 +22,30 @@ "repository": {

"dependencies": {
"tslib": "^1.9.0"
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": ">=8.0.0",
"@angular/core": ">=8.0.0",
"@angular/platform-browser": ">=8.0.0",
"rxjs": "^6.4.0",
"zone.js": ">=0.9.1"
"@angular/common": "^14.2.12",
"@angular/core": "^14.2.12",
"@angular/platform-browser": "^14.2.12",
"rxjs": "~7.5.7",
"zone.js": "~0.11.8"
},
"devDependencies": {
"@angular/common": "8.2.14",
"@angular/compiler": "8.2.14",
"@angular/compiler-cli": "8.2.14",
"@angular/core": "8.2.14",
"@angular/platform-browser": "8.2.14",
"ng-packagr": "5.7.1",
"rimraf": "^3.0.0",
"rxjs": "^6.4.0",
"tslint": "^5.20.0",
"typescript": "~3.5.3",
"zone.js": "~0.9.1"
"module": "fesm2015/trademe-ng-defer-load.mjs",
"es2020": "fesm2020/trademe-ng-defer-load.mjs",
"esm2020": "esm2020/trademe-ng-defer-load.mjs",
"fesm2020": "fesm2020/trademe-ng-defer-load.mjs",
"fesm2015": "fesm2015/trademe-ng-defer-load.mjs",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"esm2020": "./esm2020/trademe-ng-defer-load.mjs",
"es2020": "./fesm2020/trademe-ng-defer-load.mjs",
"es2015": "./fesm2015/trademe-ng-defer-load.mjs",
"node": "./fesm2015/trademe-ng-defer-load.mjs",
"default": "./fesm2020/trademe-ng-defer-load.mjs"
}
},
"module": "fesm5/trademe-ng-defer-load.js",
"es2015": "fesm2015/trademe-ng-defer-load.js",
"esm5": "esm5/trademe-ng-defer-load.js",
"esm2015": "esm2015/trademe-ng-defer-load.js",
"fesm5": "fesm5/trademe-ng-defer-load.js",
"fesm2015": "fesm2015/trademe-ng-defer-load.js",
"metadata": "trademe-ng-defer-load.metadata.json",
"sideEffects": false
}
}

@@ -45,19 +45,2 @@ # ng-defer-load

## Fall back support
`ng-defer-load` supports a fall back in browsers that do not support the IntersectionObserver API. This uses the scroll position and the element's offset. This is enabled by default.
If you do not want to allow this fallback, and would prefer the browser to just render the element regardless, you can set `fallbackEnabled` to false on the element as below:
```html
<div
[fallbackEnabled]="false"
(deferLoad)="showMyElement=true">
<my-element
*ngIf=showMyElement>
...
</my-element>
</div>
```
## Demo

@@ -89,2 +72,24 @@

v8.2.1 - Fix for IE11 and older browsers
v8.2.1 - Fix for IE11 and older browsers
v8.2.2 - Updated dependencies due to security advisories
v14.0.0 - Supports Angular 12+ (targeting Angular 14) with partial Ivy builds. Additionally, drops support for IE11.
## Deprecated features
### Fall back support (<14)
`ng-defer-load` supports a fall back in browsers that do not support the IntersectionObserver API. This uses the scroll position and the element's offset. This is enabled by default.
If you do not want to allow this fallback, and would prefer the browser to just render the element regardless, you can set `fallbackEnabled` to false on the element as below:
```html
<div
[fallbackEnabled]="false"
(deferLoad)="showMyElement=true">
<my-element
*ngIf=showMyElement>
...
</my-element>
</div>
```
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