close method on route definition to be executed like an onbeforeunload event
onbeforeunload logic for multiple controllers on same path