{"id":13535362,"url":"https://github.com/orizens/angular2-infinite-scroll","last_synced_at":"2025-03-26T12:31:43.618Z","repository":{"id":57154677,"uuid":"89369087","full_name":"orizens/angular2-infinite-scroll","owner":"orizens","description":"Infinite Scroll Directive For Angular (version 2 up to 2.3.1)","archived":false,"fork":false,"pushed_at":"2017-05-05T12:26:17.000Z","size":27,"stargazers_count":15,"open_issues_count":8,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:57:46.116Z","etag":null,"topics":["angular","angular2","infinite-scroll","scroll"],"latest_commit_sha":null,"homepage":"http://npmjs.com/package/angular2-infinite-scroll","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orizens.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-25T14:19:23.000Z","updated_at":"2024-02-09T21:44:29.000Z","dependencies_parsed_at":"2022-08-24T12:00:25.122Z","dependency_job_id":null,"html_url":"https://github.com/orizens/angular2-infinite-scroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Fangular2-infinite-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Fangular2-infinite-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Fangular2-infinite-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orizens%2Fangular2-infinite-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orizens","download_url":"https://codeload.github.com/orizens/angular2-infinite-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245654169,"owners_count":20650815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular2","infinite-scroll","scroll"],"created_at":"2024-08-01T08:00:54.880Z","updated_at":"2025-03-26T12:31:43.341Z","avatar_url":"https://github.com/orizens.png","language":"TypeScript","readme":"[![Build Status](https://travis-ci.org/orizens/angular2-infinite-scroll.svg?branch=master)](https://travis-ci.org/orizens/angular2-infinite-scroll)\n\n# DEPRECATED - Please Use The New NGX-Infinite-Scroll\n[ngx-infinite-scroll](http://github.com/orizens/ngx-infinite-scroll)\n\n# Angular Infinite Scroll\nInspired by [ng-infinite-scroll](https://github.com/sroze/ngInfiniteScroll) directive for angular (\u003e 2).\n\n## Angular Support\nSupports in Angular **\u003e +2, 4**\n\n## Angular Consulting Services\nI'm a Senior Javascript Engineer \u0026 A Front End Consultant at [Orizens](http://orizens.com).\nMy services include:  \n- consulting to companies and startups on how to approach code in their projects and keep it maintainable.  \n- I provide project bootstrapping and development - while afterwards, I integrate it on site and guide the team on it.  \n\n[Contact Me Here](http://orizens.com/contact)\n\n## Installation\n```\nnpm install angular2-infinite-scroll --save\n```\n\n## Supported API\nCurrently supported attributes:\n* **infiniteScrollDistance**\u003c_number_\u003e - (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.\n* **infiniteScrollUpDistance**\u003c_number_\u003e - (optional, default: **1.5**) - should get a number\n* **infiniteScrollThrottle**\u003c_number_\u003e - (optional, default: **300**) - should get a number of **milliseconds** for throttle. The event will be triggered this many milliseconds after the user *stops* scrolling.\n* **infiniteScrollContainer**\u003c_string|HTMLElement_\u003e - (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.\n* **scrolled**\u003c_function_\u003e - this will callback if the distance threshold has been reached on a scroll down.\n* **scrolledUp**\u003c_function_\u003e - (event: InfiniteScrollEvent) - this will callback if the distance threshold has been reached on a scroll up.\n* **scrollWindow**\u003c_boolean_\u003e - (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.\n* **immediateCheck**\u003c_boolean_\u003e - (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).\n* **infiniteScrollDisabled**\u003c_boolean_\u003e - (optional, default: **false**) - doesn't invoke the handler if set to true\n\n## Behavior\nBy default, the directive listens to the **window scroll** event and invoked the callback.  \n**To trigger the callback when the actual element is scrolled**, these settings should be configured:\n* [scrollWindow]=\"false\"\n* set an explict css \"height\" value to the element\n\n## DEMO\n- [**Default Scroll** By Window - plunkr](https://plnkr.co/edit/DrEDetYnZkFxR7OWWrxS?p=preview) \n- [Scroll On a **\"Modal\"** - plunkr](https://plnkr.co/edit/QnQOwE9SEapwJCCFII3L?p=preview)\n\n## Usage\nFirst, import the InfiniteScrollModule to your module:\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { InfiniteScrollModule } from 'angular2-infinite-scroll';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\nimport { AppComponent } from './app';\n\n@NgModule({\n  imports:[ BrowserModule, InfiniteScrollModule ],\n  declarations: [ AppComponent, ],\n  bootstrap: [ AppComponent ]\n})\nexport class AppModule { }\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n```\n\nIn this example, the **onScroll** callback will be invoked when the window is scrolled down:\n\n```typescript\nimport { Component } from '@angular/core';\n\n@Component({\n\tselector: 'app',\n\ttemplate: `\n\t\t\u003cdiv class=\"search-results\"\n\t\t    infinite-scroll\n\t\t    [infiniteScrollDistance]=\"2\"\n\t\t    [infiniteScrollThrottle]=\"300\"\n\t\t    (scrolled)=\"onScroll()\"\u003e\n\t\t\u003c/div\u003e\n\t`\n})\nexport class AppComponent {\n\tonScroll () {\n\t    console.log('scrolled!!')\n\t}\n}\n```\nin this example, whenever the \"search-results\" is scrolled, the callback will be invoked:\n\n```typescript\nimport { Component } from '@angular/core';\n\n@Component({\n\tselector: 'app',\n\tstyles: [\n\t\t`.search-results {\n\t\t\theight: 20rem;\n\t\t\toverflow: scroll;\n\t\t}`\n\t],\n\ttemplate: `\n\t\t\u003cdiv class=\"search-results\"\n\t\t    infinite-scroll\n\t\t    [infiniteScrollDistance]=\"2\"\n\t\t    [infiniteScrollThrottle]=\"500\"\n\t\t    (scrolled)=\"onScroll()\"\n\t\t    [scrollWindow]=\"false\"\u003e\n\t\t\u003c/div\u003e\n\t`\n})\nexport class AppComponent {\n\tonScroll () {\n\t    console.log('scrolled!!')\n\t}\n}\n```\n\nIn 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:\n\n```typescript\nimport { Component } from '@angular/core';\nimport { InfiniteScroll } from 'angular2-infinite-scroll';\n\n@Component({\n\tselector: 'app',\n\tdirectives: [ InfiniteScroll ],\n\ttemplate: `\n\t\t\u003cdiv class=\"search-results\"\n\t\t    infinite-scroll\n\t\t    [infiniteScrollDistance]=\"2\"\n\t\t    [infiniteScrollUpDistance]=\"1.5\"\n\t\t    [infiniteScrollThrottle]=\"500\"\n\t\t    (scrolled)=\"onScrollDown()\"\n\t\t    (scrolledUp)=\"onScrollUp()\"\u003e\n\t\t\u003c/div\u003e\n\t`\n})\nexport class AppComponent {\n\tonScrollDown () {\n\t    console.log('scrolled down!!')\n\t}\n\n\tonScrollUp () {\n    \tconsole.log('scrolled up!!')\n    }\n}\n```\n\n# Showcase Examples\n* [Echoes Player Ng2 Version](http://orizens.github.io/echoes-ng2) ([github repo for echoes player](http://github.com/orizens/echoes-ng2))\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forizens%2Fangular2-infinite-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forizens%2Fangular2-infinite-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forizens%2Fangular2-infinite-scroll/lists"}