@trademe/ng-defer-load
Advanced tools
Comparing version 14.0.0 to 14.1.0
@@ -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 @@ /** |
{ | ||
"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
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59477
487
0
14
93