All Projects → orizens → angular2-infinite-scroll

orizens / angular2-infinite-scroll

Licence: MIT license
Infinite Scroll Directive For Angular (version 2 up to 2.3.1)

Programming Languages

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

Projects that are alternatives of or similar to angular2-infinite-scroll

Vue Mugen Scroll
Infinite scroll component for Vue.js 2
Stars: ✭ 532 (+3225%)
Mutual labels:  infinite-scroll, scroll
Vue List Scroller
Simple and easy to use Vue.js component for efficient rendering large lists
Stars: ✭ 65 (+306.25%)
Mutual labels:  infinite-scroll, scroll
Infinite Ajax Scroll
Turn your existing pagination into infinite scrolling pages with ease
Stars: ✭ 804 (+4925%)
Mutual labels:  infinite-scroll, scroll
Rsdayflow
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.
Stars: ✭ 843 (+5168.75%)
Mutual labels:  infinite-scroll, scroll
Ngx Scroll To
Scroll to any element to enhance scroll-based features in you app. Works for Angular 4+, both AoT and SSR. No dependencies.
Stars: ✭ 269 (+1581.25%)
Mutual labels:  angular2, scroll
react-infinite-scroll-list
Manage infinite list with the IntersectionObserver API
Stars: ✭ 20 (+25%)
Mutual labels:  infinite-scroll, scroll
Ngx Infinite Scroll
Infinite Scroll Directive for Angular
Stars: ✭ 1,024 (+6300%)
Mutual labels:  infinite-scroll, scroll
ng-mat-select-infinite-scroll
Infinite Scroll directive for angular material select component
Stars: ✭ 39 (+143.75%)
Mutual labels:  infinite-scroll, scroll
Infinitescroll
Infinite Scroll (Endless Scrolling) for RecyclerView in Android
Stars: ✭ 183 (+1043.75%)
Mutual labels:  infinite-scroll, scroll
Ngx Ui Scroll
Infinite/virtual scroll for Angular
Stars: ✭ 145 (+806.25%)
Mutual labels:  infinite-scroll, scroll
Svelte Infinite Scroll
Infinite Scroll Component to Svelte
Stars: ✭ 102 (+537.5%)
Mutual labels:  infinite-scroll, scroll
vuejs-loadmore
A pull-down refresh and pull-up loadmore scroll component for Vue.js. Vue上拉加载下拉刷新组件
Stars: ✭ 62 (+287.5%)
Mutual labels:  infinite-scroll, scroll
Ngx Scrollspy
Angular ScrollSpy Service
Stars: ✭ 94 (+487.5%)
Mutual labels:  angular2, infinite-scroll
scrollbox
A lightweight jQuery custom scrollbar plugin, that triggers event when reached the defined point.
Stars: ✭ 15 (-6.25%)
Mutual labels:  infinite-scroll, scroll
framework7.angular2
Framework7 angular 2 integration
Stars: ✭ 14 (-12.5%)
Mutual labels:  angular2
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (+6343.75%)
Mutual labels:  infinite-scroll
angular-for-beginners-starter
A beginner friendly playground for Getting Started with Angular, by the Angular University
Stars: ✭ 52 (+225%)
Mutual labels:  angular2
angular2-yandex-maps
Angular 2 components Yandex Maps.
Stars: ✭ 26 (+62.5%)
Mutual labels:  angular2
chrome-mouse-wheel-tab-scroller
Scroll Google Chrome tabs using mouse wheel
Stars: ✭ 39 (+143.75%)
Mutual labels:  scroll
angular-http-cache
Speed up your remote requests by automatically caching them on client and add support for offline navigation.
Stars: ✭ 25 (+56.25%)
Mutual labels:  angular2

Build Status

DEPRECATED - Please Use The New NGX-Infinite-Scroll

ngx-infinite-scroll

Angular Infinite Scroll

Inspired by ng-infinite-scroll directive for angular (> 2).

Angular Support

Supports in Angular > +2, 4

Angular Consulting Services

I'm a Senior Javascript Engineer & A Front End Consultant at Orizens. My services include:

  • consulting to companies and startups on how to approach code in their projects and keep it maintainable.
  • I provide project bootstrapping and development - while afterwards, I integrate it on site and guide the team on it.

Contact Me Here

Installation

npm install angular2-infinite-scroll --save

Supported API

Currently supported attributes:

  • infiniteScrollDistance<number> - (optional, default: 2) - should get a number, the number of viewport lenghts from the bottom of the page at which the event will be triggered.
  • infiniteScrollUpDistance<number> - (optional, default: 1.5) - should get a number
  • infiniteScrollThrottle<number> - (optional, default: 300) - should get a number of milliseconds for throttle. The event will be triggered this many milliseconds after the user stops scrolling.
  • infiniteScrollContainer<string|HTMLElement> - (optional, default: null) - should get a html element or css selector for a scrollable element; window or current element will be used if this attribute is empty.
  • scrolled<function> - this will callback if the distance threshold has been reached on a scroll down.
  • scrolledUp<function> - (event: InfiniteScrollEvent) - this will callback if the distance threshold has been reached on a scroll up.
  • scrollWindow<boolean> - (optional, default: true) - listens to the window scroll instead of the actual element scroll. this allows to invoke a callback function in the scope of the element while listenning to the window scroll.
  • immediateCheck<boolean> - (optional, default: false) - invokes the handler immediately to check if a scroll event has been already triggred when the page has been loaded (i.e. - when you refresh a page that has been scrolled).
  • infiniteScrollDisabled<boolean> - (optional, default: false) - doesn't invoke the handler if set to true

Behavior

By default, the directive listens to the window scroll event and invoked the callback.
To trigger the callback when the actual element is scrolled, these settings should be configured:

  • [scrollWindow]="false"
  • set an explict css "height" value to the element

DEMO

Usage

First, import the InfiniteScrollModule to your module:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { InfiniteScrollModule } from 'angular2-infinite-scroll';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app';

@NgModule({
  imports:[ BrowserModule, InfiniteScrollModule ],
  declarations: [ AppComponent, ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }

platformBrowserDynamic().bootstrapModule(AppModule);

In this example, the onScroll callback will be invoked when the window is scrolled down:

import { Component } from '@angular/core';

@Component({
	selector: 'app',
	template: `
		<div class="search-results"
		    infinite-scroll
		    [infiniteScrollDistance]="2"
		    [infiniteScrollThrottle]="300"
		    (scrolled)="onScroll()">
		</div>
	`
})
export class AppComponent {
	onScroll () {
	    console.log('scrolled!!')
	}
}

in this example, whenever the "search-results" is scrolled, the callback will be invoked:

import { Component } from '@angular/core';

@Component({
	selector: 'app',
	styles: [
		`.search-results {
			height: 20rem;
			overflow: scroll;
		}`
	],
	template: `
		<div class="search-results"
		    infinite-scroll
		    [infiniteScrollDistance]="2"
		    [infiniteScrollThrottle]="500"
		    (scrolled)="onScroll()"
		    [scrollWindow]="false">
		</div>
	`
})
export class AppComponent {
	onScroll () {
	    console.log('scrolled!!')
	}
}

In this example, the onScrollDown callback will be invoked when the window is scrolled down and the onScrollUp callback will be invoked when the window is scrolled up:

import { Component } from '@angular/core';
import { InfiniteScroll } from 'angular2-infinite-scroll';

@Component({
	selector: 'app',
	directives: [ InfiniteScroll ],
	template: `
		<div class="search-results"
		    infinite-scroll
		    [infiniteScrollDistance]="2"
		    [infiniteScrollUpDistance]="1.5"
		    [infiniteScrollThrottle]="500"
		    (scrolled)="onScrollDown()"
		    (scrolledUp)="onScrollUp()">
		</div>
	`
})
export class AppComponent {
	onScrollDown () {
	    console.log('scrolled down!!')
	}

	onScrollUp () {
    	console.log('scrolled up!!')
    }
}

Showcase Examples

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].