How can canceled settimeout and cleartime when i changed page?


Hi, i am using settimeout at my app and that is working. but settimeout still in progress
when i changed page. How can canceled?


Hey, ı found solution !
ionViewCanLeave() { clearTimeout(this.timer); console.log("Should I leave? Yes"); return true; }
This function shows you leave the page at the ionic2 and If it turns true, that is allows you to leave the page. And runing clearTime function when i leaved page.

Have good day ! :wink: