How to use the @angular/router.RouterModule.forChild function in @angular/router

To help you get started, we’ve selected a few @angular/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / angular-bazel-example / src / app / support / support.module.ts View on Github external
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';

import {IndexComponent} from './index/index.component';
import {Module0Module} from './module0/module0.module';
import {Module1Module} from './module1/module1.module';

@NgModule({
  declarations: [IndexComponent],
  imports: [
    CommonModule, RouterModule.forChild([{path: '', component: IndexComponent}]), Module0Module,
    Module1Module
  ]
})
export class SupportModule {
}
github eclipse / winery / org.eclipse.winery.repository.ui / src / app / wineryMainModules / relationshipTypeImplementations / relationshipTypeImplementationRouter.module.ts View on Github external
resolve: {resolveData: InstanceResolver},
        children: [
            {path: 'readme', component: WineryReadmeComponent},
            {path: 'license', component: WineryLicenseComponent},
            {path: 'implementationartifacts', component: WineryArtifactComponent},
            {path: 'inheritance', component: InheritanceComponent},
            {path: 'documentation', component: DocumentationComponent},
            {path: 'xml', component: EditXMLComponent},
            {path: '', redirectTo: 'readme', pathMatch: 'full'}
        ]
    }
];

@NgModule({
    imports: [
        RouterModule.forChild(relationshipTypeImplementationRoutes),
    ],
    exports: [
        RouterModule
    ],
    providers: [
        SectionResolver,
        InstanceResolver
    ],
})
export class RelationshipTypeImplementationRouterModule {
}
github Uintra / Uintra / src / Uintra20 / Content / src / app / ui / pages / social / details / social-details-page.module.ts View on Github external
import { SocialDetailsPanelComponent } from "./social-details-page.component";
import { LikeButtonModule } from 'src/app/feature/reusable/ui-elements/like-button/like-button.module';
import { UserAvatarModule } from 'src/app/feature/reusable/ui-elements/user-avatar/user-avatar.module';
import { CommentsModule } from 'src/app/feature/reusable/ui-elements/comments/comments.module';
import { DetailasHeaderModule } from 'src/app/feature/specific/activity/details/detailas-header/detailas-header.module';
import { GroupDetailsWrapperModule } from 'src/app/feature/specific/groups/group-details-wrapper/group-details-wrapper.module';
import { AttachmentsModule } from 'src/app/feature/specific/activity/details/attachments/attachments.module';
import { TranslateModule } from '@ngx-translate/core';
import { LinkPreviewModule } from 'src/app/feature/specific/link-preview/link-preview.module';
import { UlinkModule } from "src/app/shared/pipes/link/ulink.module";

@NgModule({
  declarations: [SocialDetailsPanelComponent],
  imports: [
    CommonModule,
    RouterModule.forChild([
      { path: "", component: SocialDetailsPanelComponent }
    ]),
    UbaselineCoreModule,
    LikeButtonModule,
    UserAvatarModule,
    CommentsModule,
    DetailasHeaderModule,
    GroupDetailsWrapperModule,
    AttachmentsModule,
    TranslateModule,
    LinkPreviewModule,
    UlinkModule
  ],
  providers: [
    { provide: AS_DYNAMIC_COMPONENT, useValue: SocialDetailsPanelComponent }
  ],
github angular / components / src / dev-app / focus-trap / focus-trap-demo-module.ts View on Github external
import {MatButtonModule} from '@angular/material/button';
import {MatCardModule} from '@angular/material/card';
import {MatDialogModule} from '@angular/material/dialog';
import {MatToolbarModule} from '@angular/material/toolbar';
import {RouterModule} from '@angular/router';
import {FocusTrapDemo, FocusTrapShadowDomDemo, FocusTrapDialogDemo} from './focus-trap-demo';

@NgModule({
  imports: [
    A11yModule,
    CommonModule,
    MatButtonModule,
    MatCardModule,
    MatDialogModule,
    MatToolbarModule,
    RouterModule.forChild([{path: '', component: FocusTrapDemo}]),
  ],
  declarations: [FocusTrapDemo, FocusTrapShadowDomDemo, FocusTrapDialogDemo],
})
export class FocusTrapDemoModule {
}
github ngx-formly / ngx-formly / demo / src / app / examples / other / button / config.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { SharedModule, ExamplesRouterViewerComponent } from '../../../shared';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    SharedModule,
    AppModule,
    RouterModule.forChild([
      {
        path: '',
        component: ExamplesRouterViewerComponent,
        data: {
          examples: [{
            title: 'Buttons',
            description: `
              This demonstrates a type for buttons. Specifically using bootstrap but this could easily be adapted for other frameworks
            `,
            component: AppComponent,
            files: [
              { file: 'app.component.html', content: require('!!highlight-loader?raw=true&lang=html!./app.component.html'), filecontent: require('!!raw-loader!./app.component.html') },
              { file: 'app.component.ts', content: require('!!highlight-loader?raw=true&lang=typescript!./app.component.ts'), filecontent: require('!!raw-loader!./app.component.ts') },
              { file: 'button-type.component.ts', content: require('!!highlight-loader?raw=true&lang=typescript!./button-type.component.ts'), filecontent: require('!!raw-loader!./button-type.component.ts') },
              { file: 'app.module.ts', content: require('!!highlight-loader?raw=true&lang=typescript!./app.module.ts'), filecontent: require('!!raw-loader!./app.module.ts') },
            ],
github intershop / intershop-pwa / src / app / shopping / containers / search-page / search-page.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { SharedModule } from '../../../shared/shared.module';
import { SearchNoResultComponent } from '../../components/search/search-no-result/search-no-result.component';
import { SearchResultComponent } from '../../components/search/search-result/search-result.component';
import { ShoppingSharedModule } from '../../shopping-shared.module';

import { SearchPageContainerComponent } from './search-page.container';
import { searchPageRoutes } from './search-page.routes';

@NgModule({
  imports: [RouterModule.forChild(searchPageRoutes), SharedModule, ShoppingSharedModule],
  declarations: [SearchNoResultComponent, SearchPageContainerComponent, SearchResultComponent],
})
export class SearchPageModule {}
github burst-apps-team / phoenix / web / angular-wallet / src / app / disclaimer / disclaimer.module.ts View on Github external
import { MatButtonModule } from '@angular/material/button';


const routes = [
  {
    path: 'disclaimer',
    component: DisclaimerComponent
  }
];

@NgModule({
  declarations: [
    DisclaimerComponent
  ],
  imports: [
    RouterModule.forChild(routes),
    FuseSharedModule,
    MatButtonModule
  ]
})
export class DisclaimerModule {
}
github crossminer / scava / administration / scava-administration / src / app / layout / properties / properties-routing.module.ts View on Github external
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PropertiesComponent } from './properties.component';
import { JwtTokenGuard } from '../../shared';

const routes: Routes = [
  {
    path: '',
    canActivate: [JwtTokenGuard],
    component: PropertiesComponent
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class PropertiesRoutingModule { }
github Tangerine-Community / Tangerine / editor / src / app / core / auth / auth-routing.module.ts View on Github external
},
{
  path: 'login',
  component: LoginComponent
}, {
  path: 'manage-users',
  component: ManageUsersComponent,
  canActivate: [LoginGuard, AdminUserGuard]
},
{
  path: 'manage-users/new-user',
  component: UserResgistrationComponent,
  canActivate: [LoginGuard, AdminUserGuard]
}];
@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class AuthRoutingModule { }
github onehungrymind / angular-core-workshop / apps / dashboard / src / app / home / home-routing.module.ts View on Github external
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';

const routes: Routes = [
  {path:'', component: HomeComponent}
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class HomeRoutingModule { }