orizens / ngx-infinite-scroll

Infinite Scroll Directive for Angular
https://www.npmjs.com/package/ngx-infinite-scroll
MIT License
1.25k stars 224 forks source link

Common config #349

Closed aharadkou closed 4 months ago

aharadkou commented 4 years ago

Is it possible to create common config overriding default values of directive properties([infiniteScrollDistance], [infiniteScrollThrottle])?

ahadjithoma commented 4 years ago

would love to know about this also

orizens commented 4 years ago

@aharadkou can you provide an example of a common config?

aharadkou commented 4 years ago

@aharadkou can you provide an example of a common config? In my view it should look smth like this:

// AppModule.ts
@NgModule({
...
providers: [
{
provide: SCROLL_CONFIG,
useValue: {
infiniteScrollDistance: 1.5,
infiniteScrollThrottle: 250,
scrollWindow: false
}
}
]
})

Then value provided with SCROLL_CONFIG token should be used to set default @Input() properties for all infiniteScroll instances

orizens commented 4 years ago

@aharadkou it can help if you can link another library/component that implements

aharadkou commented 4 years ago

@aharadkou it can help if you can link another library/component that implements

@orizens Perfect scrollbar implements it https://www.npmjs.com/package/ngx-perfect-scrollbar