我希望我的应用具有这样的URL
https://example.com/rootFolder/child/other?page=1&sort=-name#lightbox/{fileID}**
我已经尝试过该路由器,但似乎无法匹配任何哈希部分。
const routes: Routes = [
{
path: '',
redirectTo: 'root',
pathMatch: 'full',
},
{
path: '#/lightbox/:fileID',
component: LightBoxComponent,
outlet: 'light-box',
},
{
matcher: lightBoxMatcher,
component: LightBoxComponent,
outlet: 'light-box',
},
{
matcher: folderMatcher, // Matches any depth of folders
component: MainComponent,
},
];
@NgModule({
imports: [
RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload',
scrollPositionRestoration: 'enabled',
paramsInheritanceStrategy: 'always',
//enableTracing: true,
}),
],
...
});