You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Though the existence of route change events like $routeChangeStartis 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.
The text was updated successfully, but these errors were encountered:
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. TheoriginalPath
property isn't currently mentioned anywhere.The text was updated successfully, but these errors were encountered: