當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。