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() {
|
ngOnDestroy() {
|
||||||
if(this.observer) {
|
if(this.observer && typeof IntersectionObserver !== 'undefined') {
|
||||||
this.observer.disconnect();
|
this.observer.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
||||||
}
|
}
|
||||||
|
|
||||||
setObserver() {
|
setObserver() {
|
||||||
|
if(typeof IntersectionObserver !== 'undefined') {
|
||||||
let options = {
|
let options = {
|
||||||
root: null,
|
root: null,
|
||||||
rootMargin: '0px',
|
rootMargin: '0px',
|
||||||
|
@ -97,6 +98,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
||||||
}, options);
|
}, options);
|
||||||
this.observer.observe(this.element.nativeElement);
|
this.observer.observe(this.element.nativeElement);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
start(time: number) {
|
start(time: number) {
|
||||||
this.stages = [];
|
this.stages = [];
|
||||||
|
|
Loading…
Reference in New Issue