I am calling a function from ngOnInit,
public ngOnInit() {
this.idleLogout();
}
public idleLogout() {
let t;
window.onload = resetTimer;
window.addEventListener('scroll', resetTimer, true);
function resetTimer() {
clearTimeout(t);
t = setTimeout(() => {
// this.openLearnMoreModal();
}, 4000);
}
}
public openLearnMoreModal() {
console.log('here')
}
I am unable to call the openLearnMoreModal function from inside the set Timeout function, it gives an error
ERROR TypeError: _this.openLearnMoreModal is not a function