Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import statement is not working in v2.0.2 #24

Open
mazid1 opened this issue Jun 29, 2021 · 1 comment
Open

Import statement is not working in v2.0.2 #24

mazid1 opened this issue Jun 29, 2021 · 1 comment

Comments

@mazid1
Copy link

mazid1 commented Jun 29, 2021

These import statements provided in readme file is not working for v2.0.2. My angular version is 10.2.x

import { NgxScrollEventModule } from 'ngx-scroll-event';
import { NgxScrollEvent } from 'ngx-scroll-event';

I had to change import statement like this:

import { NgxScrollEventModule } from 'ngx-scroll-event/dist/ngx-scroll-event';
import { NgxScrollEvent } from 'ngx-scroll-event/dist/ngx-scroll-event';

Then I have used it this way:

<div libScrollEvent (onscroll)="handleScroll($event)" [topOffset]="100">
  ...
</div>

Yet it is not working. Showing these error messages in browser console.

core.js:4442 ERROR TypeError: Cannot read property '11' of null
    at Module.ɵɵlistener (core.js:15053)
    at Object.NgxScrollEventDirective_HostBindings [as hostBindings] (ngx-scroll-event.js:38)
    at invokeHostBindingsInCreationMode (core.js:8209)
    at invokeDirectivesHostBindings (core.js:8189)
    at createDirectivesInstances (core.js:7540)
    at Module.ɵɵelementStart (core.js:14865)
    at UserResponseModuleItemComponent_div_0_Template (user-response-module-item.component.html:1)
    at executeTemplate (core.js:7511)
    at renderView (core.js:7318)
    at TemplateRef.createEmbeddedView (core.js:10116)
    
core.js:4442 ERROR Error: ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual]
    at throwError (core.js:738)
    at assertNotEqual (core.js:694)
    at initTNodeFlags (core.js:8313)
    at resolveDirectives (core.js:8048)
    at elementStartFirstCreatePass (core.js:14803)
    at Module.ɵɵelementStart (core.js:14841)
    at UserResponseModuleItemComponent_div_0_Template (user-response-module-item.component.html:1)
    at executeTemplate (core.js:7511)
    at renderView (core.js:7318)
    at TemplateRef.createEmbeddedView (core.js:10116)
@nranderson
Copy link

I too am having this same issue. I rolled back my versioning of this package to 2.0.0 and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants