Hi!
Angular version: 17.3.6
my app.routes.ts:
export const routes: Routes = [
{ path: 'builder/login', component: BuilderLoginComponent},
{ path: 'builder/me', component: BuilderMeComponent},
{ path: 'builder/editor', component: BuilderEditorComponent },
{ path: 'compis', component: AuthWebviewComponent},
{ path: '**', component: DynamicRootComponent } //this not work...
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: false })],
exports: [RouterModule]
})
In my app.component.ts I download pages and create some dynamic routes.
after download:
const dynamicRoutes: Route[] = pages.map((page: any) => ({
path: page.path,
component: DynamicPageComponent,
data: { page }
}));
const staticRoutes: Route[] = [
{ path: 'builder/login', component: BuilderLoginComponent },
{ path: 'builder/me', component: BuilderMeComponent },
{ path: 'builder/editor', component: BuilderEditorComponent },
{ path: 'compis', component: AuthWebviewComponent }
];
const combinedRoutes = staticRoutes.concat(dynamicRoutes);
this.router.resetConfig(combinedRoutes);
ERROR: When I directly access a url with a path corresponding to one of the dynamic ones, it doesn’t even go to app.component or DynamicRootComponent .
How can I get render to run any component from /*?