Skip to content

Error: Animation cancelled after host component destroy #68

@wanpeng2008

Description

@wanpeng2008

I implement an auto running slider using setInterval()

    ngAfterViewInit(): void {
        this.interval = setInterval(()=>{
            this.topSliderComponent.nextSlide().then();
        }, 5000);

    }
    ngOnDestroy(): void {
        clearInterval(this.interval);
    }

When i route to other pages, "Animation cancelled" errors are thrown again and again.

CONSOLE ERROR file:///app/tns_modules/@angular/core/bundles/core.umd.js:1686:28: ERROR Error: Uncaught (in promise): Error: Animation cancelled.
_rejectAnimationFinishedPromise@file:///app/tns_modules/tns-core-modules/ui/animation/animation-common.js:100:31 [<root>]
animationFinishedCallback@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:148:57 [<root>]
animationDidStopFinished@file:///app/tns_modules/tns-core-modules/ui/animation/animation.js:70:35 [<root>]
UIApplicationMain@[native code] [<root>]
start@file:///app/tns_modules/tns-core-modules/application/application.js:264:26 [<root>]
run@file:///app/tns_modules/tns-core-modules/application/application.js:284:10 [<root>]
bootstrapNativeScriptApp@file:///app/tns_modules/nativescript-angular/platform-common.js:157:26 [<root>]
bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:91:38 [<root>]
bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:80:26 [<root>]
anonymous@file:///app/main.js

What shall i do to eliminate this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions