Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##app.routing.ts
- const routes: Routes = [
- { path: '', component: HomeComponent },
- { path: 'login', loadChildren: 'src/app/Authorization/Authorization.module#AuthorizationModule' },
- { path: 'homepage', loadChildren: 'src/app/Flats/Flats.module#FlatsModule' },
- { path: 'notices', loadChildren: 'src/app/Notice/Notices.module#NoticesModule' },
- { path: 'fees', loadChildren: 'src/app/fees/Fees.module#FeesModule' },
- ];
- export const ModuleRouting: ModuleWithProviders = RouterModule.forRoot(routes);
- ##app.module.ts
- imports: [
- ...
- ...
- ModuleRouting (z pliku app.routing.ts)
- ]
- ## I teraz dla każdego kolejnego modułu:
- ## moduł.routing.ts
- const routes: Routes = [
- {
- path: 'notices',
- component: NoticeComponent,
- }
- ];
- export const ModuleRouting: ModuleWithProviders = RouterModule.forChild(routes);
- ## moduł.ts
- import { ModuleRouting } from './Notice.routing';
- @NgModule({
- imports: [
- ...
- ...
- ModuleRouting
- ],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement