ngx-infinite-scroll icon indicating copy to clipboard operation
ngx-infinite-scroll copied to clipboard

Common config

Open aharadkou opened this issue 4 years ago • 5 comments

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

aharadkou avatar Mar 30 '20 08:03 aharadkou

would love to know about this also

ahadjithoma avatar Apr 18 '20 15:04 ahadjithoma

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

orizens avatar Apr 20 '20 02:04 orizens

@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

aharadkou avatar Apr 20 '20 07:04 aharadkou

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

orizens avatar Jun 02 '20 15:06 orizens

@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

aharadkou avatar Jun 02 '20 16:06 aharadkou