-
Notifications
You must be signed in to change notification settings - Fork 26.5k
docs(router): Deprecate public members of Router that are meant to be configured elsewhere #48006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c671040
to
fa45fe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a few comments about additional references to replacement functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
Blocked on review of global presubmit results. |
Removing the blocked label. The TGP tested removing these APIs from the public router members (by adding the By far the most common and concerning pattern that was identified was attempting to force a refresh with The above was often accompanied with, It's clear that there is a missing feature in the router to better support hard refreshes. I don't think the current solutions (modifying the properties on the router before a navigation) are the correct ones. We should continue with the deprecation and follow up with creating new APIs to more easily accomplish these tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewed-for: public-api
… configured elsewhere None of the public properties of the `Router` are meant to be writeable. They should all be configured using other methods, all of which have been documented. DEPRECATED: router writable properties The following strategies are meant to be configured by registering the application strategy in DI via the `providers` in the root `NgModule` or `bootstrapApplication`: * `routeReuseStrategy` * `titleStrategy` * `urlHandlingStrategy` The following options are meant to be configured using the options available in `RouterModule.forRoot` or `provideRouter`. * `onSameUrlNavigation` * `paramsInheritanceStrategy` * `urlUpdateStrategy` * `canceledNavigationResolution` The following options are available in `RouterModule.forRoot` but not available in `provideRouter`: * `malformedUriErrorHandler` - This was found to not be used anywhere internally. * `errorHandler` - Developers can instead subscribe to `Router.events` and filter for `NavigationError`.
…t to be configured elsewhere
4e8c442
to
25d6694
Compare
This PR was merged into the repository by commit 0a8b8a6. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
… configured elsewhere (angular#48006) None of the public properties of the `Router` are meant to be writeable. They should all be configured using other methods, all of which have been documented. DEPRECATED: router writable properties The following strategies are meant to be configured by registering the application strategy in DI via the `providers` in the root `NgModule` or `bootstrapApplication`: * `routeReuseStrategy` * `titleStrategy` * `urlHandlingStrategy` The following options are meant to be configured using the options available in `RouterModule.forRoot` or `provideRouter`. * `onSameUrlNavigation` * `paramsInheritanceStrategy` * `urlUpdateStrategy` * `canceledNavigationResolution` The following options are available in `RouterModule.forRoot` but not available in `provideRouter`: * `malformedUriErrorHandler` - This was found to not be used anywhere internally. * `errorHandler` - Developers can instead subscribe to `Router.events` and filter for `NavigationError`. PR Close angular#48006
None of the public properties of the
Router
are meant to be writeable. They should all be configured using other methods, all of which have been documented.The following strategies are meant to be configured by registering the application strategy in DI via the
providers
in the rootNgModule
orbootstrapApplication
:routeReuseStrategy
titleStrategy
urlHandlingStrategy
The following options are meant to be configured using the options available in
RouterModule.forRoot
orprovideRouter
.onSameUrlNavigation
paramsInheritanceStrategy
urlUpdateStrategy
canceledNavigationResolution
The following options are available in
RouterModule.forRoot
but not available inprovideRouter
:malformedUriErrorHandler
- This was found to not be used anywhere internally.errorHandler
- Developers can instead subscribe toRouter.events
and filter forNavigationError
.