setInterval in AbstractJavascriptComponent

setInterval called in javascript files by AbstractJavascriptComponent is not stopped when the navigator navigates to different view. Is there a way to stop the function before changing the view?