I am currently using an event listener to check whether a user scrolled up or down. The event listener does fire when the mouse is scrolled using but when I want to call on another function it says that it is not a function or on a variable it says that it is not there or undefined/NaN if its a type number. I thought that this might be a scoping issue or a binding issue but I can't dial down on how to solve it.
ngOnInit() {
var homeelement:HTMLElement=document.querySelector( '.homebackground' ) as HTMLElement;
homeelement.addEventListener('wheel', this.findScrollDirectionOtherBrowsers);
}
findScrollDirectionOtherBrowsers(event){
var delta;
if (event.wheelDelta){
delta = event.wheelDelta;
}else{
delta = -1 * event.deltaY;
}
if (delta < 0){
//////////
//if i call a function/variable here it says that its not there or undefined if its a variable
this.callme()
}else if (delta > 0){
console.log("UP");
}
}
callme(){
console.log("gotcalled")
}