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 14.0.0 to 14.1.0

7

defer-load.directive.d.ts

@@ -8,8 +8,11 @@ import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core';

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;

@@ -20,7 +23,9 @@ 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>;
static ɵdir: i0.ɵɵDirectiveDeclaration<DeferLoadDirective, "[deferLoad]", never, { "preRender": "preRender"; "fallbackEnabled": "fallbackEnabled"; "removeListenersAfterLoad": "removeListenersAfterLoad"; }, { "deferLoad": "deferLoad"; }, never, never, false>;
}

@@ -0,0 +0,0 @@ import * as i0 from "@angular/core";

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

2

package.json
{
"name": "@trademe/ng-defer-load",
"version": "14.0.0",
"version": "14.1.0",
"description": "Angular directive to load elements lazily",

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

export * from './defer-load.module';
export * from './defer-load.directive';

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

## Fall back support
`ng-defer-load` supports a fall back in browsers or devices (like older iPhones) 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

@@ -77,19 +94,1 @@

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>
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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