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

infinite scroll EXCEPTION: TypeError: Cannot read property 'removeEventListener' of null when navigating away #5998

Closed
alzalabany opened this issue Mar 31, 2016 · 2 comments

Comments

@alzalabany
Copy link

Steps to reproduce and a minimal demo of the problem


@Page({
    providers: [WallFactory],
    template: `
    <ion-navbar *navbar>
        <button menuToggle>
            <ion-icon name="menu"></ion-icon>
        </button>
        <ion-title> Class Wall </ion-title>

    </ion-navbar>
    <ion-content>

     <ion-card *ngFor="#post of posts;trackBy:post?.id">
    </ion-card>

    <ion-infinite-scroll (infinite)="doInfinite($event)">
       <ion-infinite-scroll-content></ion-infinite-scroll-content>
     </ion-infinite-scroll>

    </ion-content>
    `
})
export class WallPage {
    posts:Array<any>;
    page:number=1;

    constructor(private nav: NavController, navParams: NavParams) {
    }
    doInfinite(infiniteScroll) {
        this.page++;
        //do some stuff
                console.log('Finished getting next page, you have ',this.posts.length);
                infiniteScroll.complete();
    }

}

Current behavior
When you leave page that contain ion-infinite-scroll it will raise an exception.

EXCEPTION: TypeError: Cannot read property 'removeEventListener' of null

TypeError: Cannot read property 'removeEventListener' of null
at InfiniteScroll._scLsn (http://localhost:8100/build/js/app.bundle.js:41822:32)
at InfiniteScroll._setListeners (http://localhost:8100/build/js/app.bundle.js:42486:37)
at InfiniteScroll.ngOnDestroy (http://localhost:8100/build/js/app.bundle.js:42502:14)

using "ionic-angular@2.0.0-beta.3"

@iignatov
Copy link
Contributor

iignatov commented Apr 2, 2016

Hi @alzalabany, this is a known issue (#5760) and will be fixed in beta.4.

@jgw96
Copy link
Contributor

jgw96 commented Apr 3, 2016

Hello! As @iignatov stated above this is a known issue and is slated to be fixed in beta.4. Thanks for opening this issue with us but as it is a duplicate of issue #5760 i will be closing this one. Thanks again!

@jgw96 jgw96 closed this as completed Apr 3, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants