Assigns type to nativeElement
This commit is contained in:
parent
2b0cf1a94b
commit
c193929bdd
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue