I am trying to migrate my angular app to standalone approach, everything is expected except some routing issues
have routes like this
const routes: Routes = [
...[':product/:id/:step', ':product/:id'].map((path: string) => (
{
path,
loadComponent: () => import('./components/form-page/form-page.component').then((m) => m.FormPageComponent),
data: { forwardToResourceRoute: false },
resolve: {
transactionConfig: TransactionConfig,
},
canDeactivate: [CanDeactivateFormPageGuard],
}
)),
{
path: '',
loadComponent: () => import('./components/form-page/form-page.component').then((m) => m.FormPageComponent),
data: { forwardToResourceRoute: true },
resolve: {
transactionConfig: TransactionConfig, // navigating new url inside resolver :product/:id/:step
},
}
]
with old approach this works fine using RouterModule with useHash: true
now migrated to ProvideRouter
provideRouter(
routes,
withHashLocation(),
)
now i don’t receive my query params like before, need a param id to navigate to another url with in resolver but getting empty urlTree
what does it really change here, by removing withHashLocation() then i get my params as expected but need hashing stratagy
did not find better way to navigate directly without component in empty path, may be there is a better way to do this by removing some duplication code (currently FormPageComponent using twice)
does anyone have better idea to handle this and fix hash location stratagy
thx in advance