Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$route service should have a beforeunload hook #388

Closed
groner opened this issue Jun 14, 2011 · 4 comments
Closed

$route service should have a beforeunload hook #388

groner opened this issue Jun 14, 2011 · 4 comments
Milestone

Comments

@groner
Copy link
Contributor

groner commented Jun 14, 2011

A before(route)unload hook would allow the application to detect unsaved changes and then save them, or prompt the user.

There was a discussion of this on the list, but it looks like an issue was never entered.

https://groups.google.com/d/topic/angular/9k5aFPoz3Ro/discussion

As Unirgy noted, the onChange hook is too late and lacks a mechanism for canceling the navigation.

@mhevery
Copy link
Contributor

mhevery commented Jun 14, 2011

This is a duplicate of: #354

@groner
Copy link
Contributor Author

groner commented Jun 14, 2011

The onHashSearchChange function sounds promising. I would need to a way to cancel the change from that function.

I think this is a different issue, but I can close it if you still think this is a duplicate.

@IgorMinar
Copy link
Contributor

We are thinking about implementing this via a common event system see: https://groups.google.com/forum/#!topic/angular/i975GJaXNME

@vojtajina
Copy link
Contributor

Closing as we already have $beforeRouteChange and $afterRouteChange events...
For canceling route change, I created separate issue: #592

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants