All Projects → anasAsh → ngx-scroll-event

anasAsh / ngx-scroll-event

Licence: MIT license
An Angular 2+ directive to handle scroll events on an element.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngx-scroll-event

Learn Angular From Scratch Step By Step
Angular step by step tutorial covering from basic concepts of Angular Framework to building a complete Angular app using Angular Material components. We will go through the main building blocks of an Angular 7 application as well as the best practices for building a complete app with Angular.
Stars: ✭ 140 (+351.61%)
Mutual labels:  angular4, angular5
Popover
Angular CDK Popover, no default style, examples using @angular/material
Stars: ✭ 156 (+403.23%)
Mutual labels:  angular4, angular5
Amazing Time Picker
Timepicker (Clock Picker) for Angular 2, Angular 4 and Angular 5, Angular 6, Angular 7 - Compatible with Angular Material
Stars: ✭ 142 (+358.06%)
Mutual labels:  angular4, angular5
Angular5 Seed
Angular5 Seed for Application
Stars: ✭ 222 (+616.13%)
Mutual labels:  angular4, angular5
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+8870.97%)
Mutual labels:  angular4, angular5
Fusebox Angular Universal Starter
Angular Universal seed project featuring Server-Side Rendering, @fuse-box bundling, material, firebase, Jest, Nightmare, and more
Stars: ✭ 132 (+325.81%)
Mutual labels:  angular4, angular5
Ng2 Pdfjs Viewer
An angular 8 component for PDFJS and ViewerJS (Supports angular 2/4/5/6/7)
Stars: ✭ 150 (+383.87%)
Mutual labels:  angular4, angular5
Angular Admin Lte
AdminLte for Angular 2
Stars: ✭ 109 (+251.61%)
Mutual labels:  angular4, angular5
Ng2 Idle
Responding to idle users in Angular (not AngularJS) applications.
Stars: ✭ 240 (+674.19%)
Mutual labels:  angular4, angular5
Sb Admin Bs4 Angular 8
Simple Dashboard Admin App built using Angular 8 and Bootstrap 4
Stars: ✭ 1,931 (+6129.03%)
Mutual labels:  angular4, angular5
Ngx Order Pipe
▼ Angular 5+ orderBy pipe
Stars: ✭ 224 (+622.58%)
Mutual labels:  angular4, angular5
Ngx Daterangepicker Material
Pure Angular 2+ date range picker with material design theme, a demo here:
Stars: ✭ 169 (+445.16%)
Mutual labels:  angular4, angular5
Ng Simple Slideshow
A simple, responsive slideshow for Angular 4+.
Stars: ✭ 119 (+283.87%)
Mutual labels:  angular4, angular5
Ng2 Search Filter
Angular 2 / Angular 4 / Angular 5 custom pipe npm module to make a search filter on any input, 🔥 100K+ downloads
Stars: ✭ 137 (+341.94%)
Mutual labels:  angular4, angular5
Aspnetcore Angular Universal
ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
Stars: ✭ 1,455 (+4593.55%)
Mutual labels:  angular4, angular5
Angular5 Iot Dashboard
Multipurpose dashboard admin for IoT softwares, remote control, user interface. Develop your client dashboards in Angular 5 with vast variety of components available.
Stars: ✭ 148 (+377.42%)
Mutual labels:  angular4, angular5
Ng2 Flatpickr
Angular 2+ wrapper for flatpickr (https://github.com/chmln/flatpickr)
Stars: ✭ 91 (+193.55%)
Mutual labels:  angular4, angular5
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (+196.77%)
Mutual labels:  angular4, angular5
Amexio.github.io
Amexio is a rich set of Angular 7 (170+) components powered by HTML5 & CSS3 for Responsive Design and with 80+ Material Design Themes, UI Components, Charts, Gauges, Data Point Widgets, Dashboards. Amexio is completely Open Sourced and Free. It's based on Apache 2 License. You can use it in your production grade work today at no cost or no obligation.
Stars: ✭ 163 (+425.81%)
Mutual labels:  angular4, angular5
Angular Google Maps
Angular 2+ Google Maps Components
Stars: ✭ 1,982 (+6293.55%)
Mutual labels:  angular4, angular5

Now supports Angular 10+

ngx-scroll-event

An Angular 2+ directive to emit an event if scroll occurs on an element or window.

Features

  • Detect scroll on an element or window and emits an event, also calculates if the user is reaching the top/bottom of that element or not.

Install

  • With NPM
npm install ngx-scroll-event --save
  • With Yarn
yarn add ngx-scroll-event

Usage

Import ScrollEvent and add it to the imports array of your module.

// app.module.ts
import { NgxScrollEventModule } from 'ngx-scroll-event';

@NgModule({
  imports: [
    ...,
    NgxScrollEventModule,
    ...,
  ]
})
export class AppModule { }

In your template you may now add the libScrollEvent attribute and (onscroll) event to any element. you can also add [bottomOffset] or [topOffset] to change when reaching bottom or top detection, bot values defaults to 100px, the value should be a number in pixels.

// app.awesome.component.ts

...
import { NgxScrollEvent } from 'ngx-scroll-event';
...

@Component({
   ...
   template: `...
        <div libScrollEvent (onscroll)="handleScroll($event)" [bottomOffset]="200" [topOffset]="200" >
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
            <div>Bla bla bla</div>
        <div>
   ...`,
})
export class AwesomeComponent {
  public handleScroll(event: NgxScrollEvent) {
    console.log('scroll occurred', event.originalEvent);
    if (event.isReachingBottom) {
      console.log(`the user is reaching the bottom`);
    }
    if (event.isReachingTop) {
      console.log(`the user is reaching the top`);
    }
    if (event.isWindowEvent) {
      console.log(`This event is fired on Window not on an element.`);
    }

  }
}

Code scaffolding

Run ng generate component component-name --project ngx-scroll-event to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-scroll-event.

Note: Don't forget to add --project ngx-scroll-event or else it will be added to the default project in your angular.json file.

Build

Run ng build ngx-scroll-event to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build ngx-scroll-event, go to the dist folder cd dist/ngx-scroll-event and run npm publish.

Running unit tests

Run ng test ngx-scroll-event to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].