unload beforeunload event in Angular