Hi everyone, first all, english it’s not my native language, probably i gonna write something wrong here, anyway sorry.
I want to call removeEventListener in ionViewWillLeave, but the function eventClick only existe inside a DidLoad, someone can help?
ChatPage.ts
ionViewDidLoad() {
function eventClick ( e: any){
console.log(e.target);
}
window.addEventListener('click', eventClick);
}
ionViewWillLeave(){
//I want to call window.removeEventListener here
}