in Education by
I have these routes /items/:id /items /items/:id/edit ... etc I want to put the component, to which I map /items/:id/edit, inside a separate lazy loaded module than the components to which the other routes are mapped. I want to do this because the component associated to /items/:id/edit is very heavy and calls a lot of submodules that are not necessary for the other routes. Ideally, I would like to do something like this configuration (that unfortunately doesn't work): @NgModule({ imports: [ RouterModule.forRoot([ { // If the route matches "items/:id/edit", then look inside this module path: 'items/:id/edit', loadChildren: './items_editor/items_editor.module#ItemsEditorModule', }, { // Otherwise look inside this other one path: 'items', loadChildren: './items/items.module#ItemsModule', }, ]); ], }); At the moment, since I didn't find a way to achieve my goal, I worked around it by renaming the path to "items/:id/edit" into "items_editor/:id": @NgModule({ imports: [ RouterModule.forRoot([ { path: 'items', loadChildren: './items/items.module#ItemsModule', }, { path: 'items-editor', loadChildren: './items_editor/items_editor.module#ItemsEditorModule', }, ]); ], }); However, I don't like this change because they are not REST names. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
the only option for this case is using UrlMatcher in route config, and with the help of it dont delegate items/:id/edit path to the ItemsModule, see https://angular.io/api/router/UrlMatcher fore details

Related questions

0 votes
    I have these routes /items/:id /items /items/:id/edit ... etc I want to put the component, to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have a mat-table with a component app-order-statuses on every row. the component calls the statuses ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have an angular 7 project and I'm using Angular universal. Everything is working fine except when I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I have a simple submit method, where Console.log(11) is printed first then console.log(1). I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I have this template that I used everywhere in my project : {{ event.title }} {{ event.content } ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I have a simple submit method, where Console.log(11) is printed first then console.log(1). I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I create an angular library "mylib" I create a service which uses BehaviorSubject Observable from rxjs. For ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm using Angular Material in my application. I have input fields like this: E-mail Which produces a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm using Angular Material in my application. I have input fields like this: E-mail Which produces a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have this template that I used everywhere in my project : {{ event.title }} {{ event.content } ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    I need to create an new link from the current route: https://website.com/post/99 = curent browser ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I need to create an new link from the current route: https://website.com/post/99 = curent browser ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I have a json file contains a icons object like this: "icons" : { "logo" : "fa fa-caret-down ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I've seen a few other solutions (Show activity Indicator while loading a lazy loaded Module in Angular 2, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    so with ng2 rc.6 I am getting an error of: Uncaught (in promise) Error: (SystemJS) SyntaxError: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
...