-
Notifications
You must be signed in to change notification settings - Fork 27k
feat(router): add withLocationStrategy for standalone router api #47986
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
feat(router): add withLocationStrategy for standalone router api #47986
Conversation
5805cb5 to
72d997c
Compare
|
This is intended. If you want to use |
|
@atscott I agree that Hash location strategy is a one liner but in my opinion because it relates to Router, it should be included at least as an interface property of First of all it is not documented at all that using Angular 14.2's Let assume that we also have providers: [
importProvidersFrom(
RouterModule.forRoot(appRoutes, { useHash: true, paramsInheritanceStrategy: 'always' }),
...
)
]And this is how we have to do using providers: [
provideRouter(appRoutes, withRouterConfig({ paramsInheritanceStrategy: 'always' })),
importProvidersFrom(
...
{ provide: LocationStrategy, useClass: HashLocationStrategy },
)
]I don't know about your opinion, but if you ask me, first way makes more sense as useHash relates to router config. |
|
@vmuresanu Technically the hash strategy is a location configuration in I do think it becomes confusing when there are multiple ways to do things that seem just about the same. "Why At the very least, I do agree with you on the documentation. Would you like to send over a PR to update the page here? https://angular.io/guide/router PS: your example does not need |
|
Understood, thanks for the detailed explanation. Sure, I would like to make a PR regarding updating the page. Will link it here as well when it is ready. |
|
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. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
With version 14's standalone API
createRouternow will have a new function configwithLocationStrategythat we can set whether we want to use hash or not. If not provided the default is Path Location StrategyDoes this PR introduce a breaking change?
Other information