qdouble / angular-webpack-starter

A complete Angular 6 and Webpack 4 starter seed with minimal and full featured branches. Full featured branch includes: Material Design 2 (Bootstrap 4 branch available as well), @ngrx, HMR, DLLs and optional use of Universal for server-side rendering - Supports AOT (offline) compilation, sync and lazy loading. Karma/Protractor for e2e/unit tests.
MIT License
883 stars 181 forks source link

reuse module #204

Closed norbert-tasi closed 6 years ago

norbert-tasi commented 7 years ago

Hello,

Is it possible to reuse a module routing? I mean I have for example BlogModule(with routes blog, blog/:id) and I want to attach it for guest and admin users, so I'd like to add to /guest and /admin /guest/blog, /guest/blog/111 /admin/blog, /admin/blog/111 and why? For guests and admins the layout is different, but the nested blog should be the same, but now it is as if it replace the root. I have router-outlet in the app.component, guest.component and blog.component. maybe it is not allowed to nesting in three levels. /blog, /blog/111 are working.

Thank you, in advance

qdouble commented 7 years ago

I don't fully understand your question

ssi-hu-tasi-norbert commented 7 years ago

I have a lazy loaded module. for example BlogModule with routing. I have two other module, AdminModule, GuestModule and both module use loadChildren for the BlogModule. So is it possible to load a module for more than one modules as a submodule?

blog routes: [... path: '', component: BlogComponent, path: ':id', component: BlogViewComponent ... ]

admin routes: [... path: 'blog', loadChildren: '../blog/blog.module#BlogModule' ... ] guest routes: [... path: 'blog', loadChildren: '../blog/blog.module#BlogModule' ... ] app routes: [... {path: 'guest', loadChildren: './guest/guest.module#GuestModule'}, {path: 'admin', loadChildren: './guest/guest.module#AdminModule'} ... ] I'd like to get /guest/blog, /guest/blog/:id and /admin/blog, /admin/blog/:id paths, but it does not work.

qdouble commented 6 years ago

Seems outside the scope of this repo