0.0.3 • Published 5 years ago

ngx-intersect v0.0.3

Weekly downloads
12
License
-
Repository
-
Last release
5 years ago

NgxIntersect

Angular wrapper of IntersectionObservable API.

Installation

Using npm:

npm i ngx-intersect

Usage

Import NgxIntersectModule into your module.

Use ngxIntersect directive to get enter/exit viewport events.

  <div class="box" 
         ngxIntersect
         (intersectionChanged)="updateThreshold($event, 'box1')"
         (withinViewChanged)="log($event, 'box1')">
         ... My Content
  </div>

Use @Input() threshold and @Input() rootMargin to configure intersection thresholds.

Use ngxIntersectAnchor to anchor ancestor element as viewport.

  <div class="container" ngxIntersectAnchor>
    <div class="box" 
           ngxIntersect
           (intersectionChanged)="updateThreshold($event, 'box1')"
           (withinViewChanged)="log($event, 'box1')">
           ... My Content
    </div>
  </div> 

TODO:

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago