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

The arguments emitted with route change events are undocumented #10994

Closed
ExplodingCabbage opened this issue Feb 6, 2015 · 1 comment
Closed

Comments

@ExplodingCabbage
Copy link

Though the existence of route change events like $routeChangeStart is documented, there is presently no mention I can find in the documentation of the two additional arguments that handlers for these events receive, representing the previous and new route. It is only through Stack Overflow questions like http://stackoverflow.com/questions/11541695/redirecting-to-a-certain-route-based-on-condition, issues like #1907, and a fair bit of experimentation that I am aware of these arguments and what they contain.

Worse still, many useful properties of these objects are provided via their prototypes and don't show up when the objects are logged to the Chrome console, unless you expand the __proto__ property. For example, the .originalPath property does not show up in the console. This seems to have caused genuine confusion; note that the highly upvoted top answerer to this SO question with >130000 views seems not to have realised that the .originalPath property exists, and has recommended detecting which route has been hit via the .templateUrl property. I'm going to try to get that answer improved, but it would help if the official docs were better. The originalPath property isn't currently mentioned anywhere.

@petebacondarwin
Copy link
Contributor

Closed by angular/dgeni-packages@860dce9

I hope !!

Please let me know if I am wrong.

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

No branches or pull requests

3 participants