From c193929bdd1413c662535b0fd12b975f3dc81880 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Mon, 21 Oct 2019 22:55:17 -0400 Subject: [PATCH] Assigns type to nativeElement --- src/app/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'; }