Closed vilmosioo closed 10 years ago
You're assuming the requests were $ route related.
No. Calling $route.reload() will call all controllers/services/directives involved and it will perform all requests again (which is what you want). Also, $route.reload() does NOT perform a hard refresh in the browser.
Consider a case where user's session is expired at server side. A post request creates a 401 and redirects to login page occurs. In this case after login all requests must be replayed and $route.reload()
can not help.
Oh I see, user-generated requests! Brilliant answer, thanks!
@stu-salsbury and @cemo are right. More than that, what if I don't use $route at all? Login process does not have to have anything to do with $route service. Oh, and what if application uses $route and $route.reload() will destroy everything user has done on the view, like writing long text? Would you dare to destroy it? :)
Just curious, why don't you just perform a $route.reload() to redo all the previously unauthorized requests?
PS: Thanks for the great tutorial!