当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript RouterModule.forChild方法代码示例

本文整理汇总了TypeScript中@angular/router.RouterModule.forChild方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RouterModule.forChild方法的具体用法?TypeScript RouterModule.forChild怎么用?TypeScript RouterModule.forChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/router.RouterModule的用法示例。


在下文中一共展示了RouterModule.forChild方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

import {AboutComponent} from "./about.component";
import {RouterModule} from "@angular/router";

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

export default RouterModule.forChild(routes);
开发者ID:Uter1007,项目名称:sumobase.ng2,代码行数:8,代码来源:about.routes.ts

示例2:

import { ModuleWithProviders } from '@angular/core';
import { RouterModule } from '@angular/router';

import { WarehouseCmp } from './warehouse';
import { WarehouseDetailCmp} from './detail/detail';
import { WarehouseImportCmp } from './import/import';


export const routing: ModuleWithProviders = RouterModule.forChild([
  { path: 'warehouse', component: WarehouseCmp },
  {path: 'warehouse-detail/:id', component: WarehouseDetailCmp },
  {path: 'warehouse-import', component: WarehouseImportCmp },
]);
开发者ID:trucduong,项目名称:springmvc,代码行数:13,代码来源:warehouse.routing.ts

示例3:

import { NgModule } from '@angular/core';
import { CommonModule, } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { ModuleWithProviders } from '@angular/core';
import {AboutComponent} from './about.component';

const routes: Routes =[
    {path: '',
    component: AboutComponent,
    children: [
    { path: '', redirectTo: 'home', pathMatch: 'full' },
    {path: '**', redirectTo: 'home' }
    ] 
    }
];

export const routing = RouterModule.forChild(routes);
开发者ID:rahulsingh0394,项目名称:csquare_ui,代码行数:17,代码来源:about.routing.ts

示例4:

  {
    path: 'crisis-center',
    component: CrisisCenterComponent,
    children: [
      // #docregion admin-route
      {
        path: 'admin',
        component: CrisisAdminComponent,
        canActivate: [AuthGuard]
      },
      // #enddocregion admin-route
      // #docregion crisis-detail-resolve
      {
        path: ':id',
        component: CrisisDetailComponent,
        canDeactivate: [CanDeactivateGuard],
        resolve: {
          crisis: CrisisDetailResolve
        }
      },
      // #enddocregion crisis-detail-resolve
      {
        path: '',
        component: CrisisListComponent
      }
    ]
  }
];

export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes);
开发者ID:Priestch,项目名称:angular.io,代码行数:30,代码来源:crisis-center.routing.5.ts

示例5:

import { RouterModule, Routes } from '@angular/router';
import { AirexchangeFormComponent } from './airexchange-form/airexchange-form.component';

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

export const AirexchangeRoutes = RouterModule.forChild(routes);

开发者ID:1ceeeeee,项目名称:VentCalc,代码行数:8,代码来源:airexchange.routes.ts

示例6:

import { ModuleWithProviders } from '@angular/core';
import { RouterModule }        from '@angular/router';

import { ContactComponent }    from './contact.component.3';

export const routing: ModuleWithProviders = RouterModule.forChild([
  { path: 'contact', component: ContactComponent}
]);
开发者ID:Priestch,项目名称:angular.io,代码行数:8,代码来源:contact.routing.3.ts

示例7:

import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ChildCheckinComponent } from './child-checkin.component';
import { RoomComponent } from './room';

const childCheckinRoutes: Routes = [
  {
    path: 'child-checkin',
    component: ChildCheckinComponent,
    children: [
      {
        path: 'room',
        component: RoomComponent
      },
    ]
  }
];

export const childCheckinRouting: ModuleWithProviders = RouterModule.forChild(childCheckinRoutes);
开发者ID:crdschurch,项目名称:crds-signin-checkin,代码行数:20,代码来源:child-checkin.routes.ts

示例8:

				loadChildren: "../pages/agentAnalytics/agentAnalytics.module#AgentAnalyticsModule"
			},
			{
				path: "usersdata",
				loadChildren: "../pages/leads/leads.module#LeadsModule"
			},
			{
				path: "support",
				loadChildren: "../pages/support/support.module#SupportModule"
			},
			//---------------------------------------------------------->
			//Page Layouts
			//---------------------------------------------------------->
			//
			//---------------------------------------------------------->
			//Helper Classes
			//---------------------------------------------------------->
			{
				path: "helper-classes",
				loadChildren: "../pages/helper-classes/helper-classes.module#HelperClassesModule"
			}

		]
	},

	// 404 Page Not Found
	{ path: "**", redirectTo: "dashboards" }
];

export const LayoutRoutes = RouterModule.forChild(LAYOUT_ROUTES);
开发者ID:Kitsune-tools,项目名称:Ana-Analytics-Dashboard,代码行数:30,代码来源:layout.routes.ts

示例9:

import { ModuleWithProviders }  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { DashboardComponent } from './ss-dashboard.component';

export const routing: ModuleWithProviders = RouterModule.forChild([
  { path: 'dashboard', component: DashboardComponent}
]);
开发者ID:MauroMS,项目名称:SecretSanta,代码行数:8,代码来源:ss-dashboard.routing.ts

示例10:

import { ModuleWithProviders } from '@angular/core';
import { RouterModule } from '@angular/router';

import { BootstrapDemo } from './bootstrap-demo';
import { BootstrapDemoPage } from './bootstrap-demo-page/bootstrap-demo-page';
import { ModalCustomisationWizard } from './modal-customisation-wizard/modal-customisation-wizard';

export const routing: ModuleWithProviders = RouterModule.forChild([
  { path: 'bootstrap-demo', component: BootstrapDemo, children: [
      { path: '', component: BootstrapDemoPage, terminal: true },
      // { path: 'customizeModals', component: ModalCustomisationWizard }
    ]
  }
]);

开发者ID:davidmarquis,项目名称:angular2-modal,代码行数:14,代码来源:bootstrap-demo.routes.ts


注:本文中的@angular/router.RouterModule.forChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。