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

Unsubscribe on OnDestroy #24

Open
pegamon opened this issue Sep 5, 2018 · 1 comment
Open

Unsubscribe on OnDestroy #24

pegamon opened this issue Sep 5, 2018 · 1 comment

Comments

@pegamon
Copy link

pegamon commented Sep 5, 2018

There is missing unsubscribe in OnDestroy of ui-carousel.component. When carousel is in autoplay mode error occurs every set interval.

Very dirty hotfix by bold in ui-carousel/ui-carousel.component.js:
UICarouselComponent.prototype.ngOnDestroy = function () {
this.nextSubject.unsubscribe();
this.prevSubject.unsubscribe();
clearInterval(this.interval);
}

This is only to show, where is problem . :)

Hotfix in application is to set up ui-carousel autoplay=false before OnDestroy is called.

@jmcomby
Copy link

jmcomby commented Dec 7, 2018

Thx for the hint.
Added in my Component:
import { UICarouselComponent } from 'ui-carousel/dist/src/ui-carousel/ui-carousel.component'
...
@ViewChild('carousel')
private uicarousel: UICarouselComponent;
...
ngOnDestroy(): void {
clearInterval(this.uicarousel.interval);
}
Fix the error.

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