orizens / ngx-infinite-scroll

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

Angular 4.1.0 + TyepScript : Can't bind to 'infiniteScrollDistance' since it isn't a known property of 'div' #222

Closed Jvick13 closed 6 years ago

Jvick13 commented 6 years ago

When I tried to compile using AOT I got these error.

I put the import of InfiniteScrollModule in the app.module.

orizens commented 6 years ago

this error is not cause because of AOT. try following the demo code.

Jvick13 commented 6 years ago

Sorry, i did't explain with calrity what happen. Is the first time that I tried to use ngx-infinite-scroll. I follow the steps, installing and import the InfiniteScrollModule to the main module, I tried to use this code in another module of the poject but when I tried to run this error appear:

Can't bind to 'infiniteScrollDistance' since it isn't a known property of 'div'. ("<div infiniteScroll [ERROR ->][infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()"> ")

This is the code that I use

<div infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()"> </div>

gregduffield commented 6 years ago

Had the same issue, make sure that you are also exporting the Module as well as Importing in your module.ts

Jvick13 commented 6 years ago

OMG! Hahahaha, Thanks @gregduffield I finally realized what's the matter, how dumb!

Nikitas-io commented 3 years ago

Had the same issue, make sure that you are also exporting the Module as well as Importing in your module.ts

Can somebody please explain what this means? Export WHICH module from where and Import WHICH module?

ErEngineering commented 2 years ago

Hello @gregduffield, @Jvick13 Could you explain the solution please, i have the same problem and i don't understand your explanations

gii-rish commented 2 years ago

Import InfiniteScrollModule in that module where you are using the infinite scroll.

ZaidPathan commented 1 year ago

Installing v10.x worked for me as my project Angular version is 12.x.