Slider container: Fix error about observer
This commit is contained in:
parent
5948d61a47
commit
8d6522270c
|
@ -60,7 +60,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
|||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if(this.observer) {
|
||||
if(this.observer && typeof IntersectionObserver !== 'undefined') {
|
||||
this.observer.disconnect();
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
|||
}
|
||||
|
||||
setObserver() {
|
||||
if(typeof IntersectionObserver !== 'undefined') {
|
||||
let options = {
|
||||
root: null,
|
||||
rootMargin: '0px',
|
||||
|
@ -97,6 +98,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
|||
}, options);
|
||||
this.observer.observe(this.element.nativeElement);
|
||||
}
|
||||
}
|
||||
|
||||
start(time: number) {
|
||||
this.stages = [];
|
||||
|
|
Loading…
Reference in New Issue