2.2.0 • Published 6 months ago

ngx-intersection2 v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

NgxIntersection

DEMO

Installation

Use this following command to install:

npm i ngx-intersection2

Usage

You can import the component(standalone component) into your module or component which you want to use:

import { NgxIntersectionComponent } from 'ngx-intersection2';

@NgModule({
  declarations: [YourComponent],
  imports: [NgxIntersectionComponent],
})
export class YourModule {}

Using

HTML template:

<ngx-intersection (isIntersecting)="handleIntersection()" [threshold]="threshold">
<!-- Your markup here -->
</ngx-intersection>

TS:

// default value is 0.75
threshold = 0.25;

handleIntersection() {
    // do smth
}

*** threshold is the percentage of the observed element within the root. Use this to trigger an intersection when a percentage of the observed element is within the root i.e. trigger when 65% of my element is within the viewport (root). Values are % based between 0 and 1. i.e. threshold: .65

2.2.0

6 months ago

2.1.2

9 months ago

2.1.1

9 months ago

2.1.0

9 months ago

2.0.0

9 months ago

1.0.1

1 year ago

1.0.0

1 year ago