-1

I have followed this answer as guide to load routes from backend:

Angular 5 Build routes from API data at startup

and after I done it I have new routes from responses added to router.config as they should be but for some case I can't access them when I enter added path from http response I get an error: ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'test', but when I log router.config there is such a path properly configured.

Any ideas why is that happening in Angular 11 ?

Jake11
  • 801
  • 2
  • 11
  • 24

1 Answers1

0

The reason for that is this declaration:

@NgModule({
    imports: [RouterModule.forRoot(routes, {
      initialNavigation: 'enabled',

where I used initialNavigation: 'enabled' for SSR, please comment if u know how to combine SSR with loading routes from API.

Jake11
  • 801
  • 2
  • 11
  • 24