diff --git a/src/app/util.ts b/src/app/util.ts index c272464..d63b73d 100644 --- a/src/app/util.ts +++ b/src/app/util.ts @@ -11,7 +11,8 @@ export const isEven = (i: number, ifTrue?: string, ifFalse?: string): string | b export const getScrollState = (el: ElementRef): string => { const hOffset = window.innerHeight * 0.75; - const componentPosition = el.nativeElement.offsetTop; + const nativeEl: HTMLElement = el.nativeElement; + const componentPosition = nativeEl.offsetTop; const scrollPosition = window.pageYOffset + hOffset; return scrollPosition >= componentPosition ? 'show' : 'hide'; }