當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript router.provideRoutes函數代碼示例

本文整理匯總了TypeScript中@angular/router.provideRoutes函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript provideRoutes函數的具體用法?TypeScript provideRoutes怎麽用?TypeScript provideRoutes使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了provideRoutes函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     imports: [RouterTestingModule],
     declarations: [HeaderComponent, FooterComponent, AppComponent],
     providers: [provideRoutes([])]
   });
 });
開發者ID:ServiceStack,項目名稱:ServiceStackVS,代碼行數:7,代碼來源:app.component.spec.ts

示例2: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     declarations: [TestRouterComponent, AppComponent],
     imports: [RouterTestingModule, RouterModule],
     providers: [provideRoutes(config)]
   });
 });
開發者ID:garlictech,項目名稱:generator-garlic-webapp,代碼行數:7,代碼來源:app.component.spec.ts

示例3: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     imports: [RouterTestingModule],
     declarations: [AppComponent, SidebarMenuComponent, TopNavComponent],
     providers: [provideRoutes([])]
   });
 });
開發者ID:demoiselle,項目名稱:example,代碼行數:7,代碼來源:app.component.spec.ts

示例4: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     imports: [RouterTestingModule],
     declarations: [AppComponent],
     providers: [ApiService, provideRoutes([])]
   });
 });
開發者ID:31H0B1eV,項目名稱:angular2-webpack,代碼行數:7,代碼來源:app.component.spec.ts

示例5: beforeEach

 beforeEach(async(() => {
   addMatchers();
   TestBed.configureTestingModule({
     imports: [MailModule, RouterTestingModule],
     providers: [provideRoutes([])]
   });
   TestBed.compileComponents();
 }));
開發者ID:vsavkin,項目名稱:router_mailapp,代碼行數:8,代碼來源:integration.spec.ts

示例6: main

export function main() {
  bootstrap(InboxApp, {
    providers: [
      provideRoutes(ROUTER_CONFIG),
      {provide: LocationStrategy, useClass: HashLocationStrategy}
    ],
    modules: [RouterModule]
  });
}
開發者ID:AudreyChao,項目名稱:angular,代碼行數:9,代碼來源:index.ts

示例7: main

export function main() {
  bootstrap(InboxApp, {
    providers: [
      provideRoutes(ROUTER_CONFIG),
      {provide: LocationStrategy, useClass: HashLocationStrategy}
    ],
    declarations: [InboxCmp, DraftsCmp],
    imports: [RouterModule]
  });
}
開發者ID:XcodeFi,項目名稱:angular,代碼行數:10,代碼來源:index.ts

示例8: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     imports: [ RouterTestingModule ],
     declarations: [ MyApp, About, Home ],
     providers: [
       // In RC.6 provideRoutes() will be replaced with
       // RouterTestingModule.withRoutes()
       provideRoutes(ROUTES)
     ]
   })
 });
開發者ID:Farata,項目名稱:angular2-webpack-starter,代碼行數:11,代碼來源:app.spec.ts

示例9: beforeEach

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [HttpModule, BrowserAnimationsModule],
      declarations: [AboutComponent],
      providers: [ HttpgetService, DataActions, NgRedux, PrepareObj, provideRoutes([])]
    }).compileComponents();

    TestBed.overrideComponent(AboutComponent, {
      set: {
        providers: [
          { provide: TopService, useClass: TopServiceMock },
          { provide: CommonCalls, useClass: CommonCallsMock }
          
        ]
      }
    })
  });
開發者ID:IDRATHERDANCE,項目名稱:angula2-first-project,代碼行數:17,代碼來源:about.component.spec.ts

示例10: provideRoutes

ďťżimport { RouterModule, provideRoutes, Routes } from '@angular/router';
import { Dashboard } from "./queue";
import { TaskDetailComponent } from "./task-detail-component";
import { TaskListComponent } from "./task-list-component";
import { AddTaskComponent } from "./add-task-component";
import { LoginComponent } from "./login-component";
import { CustomerListComponent } from "./customer-component";

export const possibleRoutes: Routes = [
    { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
    { path: 'dashboard', component: Dashboard },
    { path: 'customers', component: CustomerListComponent },
    { path: 'tasks', component: TaskListComponent },
    { path: 'detail/:id', component: TaskDetailComponent },
    { path: 'newTask', component: AddTaskComponent },
    { path: 'login', component: LoginComponent }
];

export const appRouterProviders = [
    provideRoutes(possibleRoutes)
];
開發者ID:darthbob88,項目名稱:Queue-Bot,代碼行數:21,代碼來源:app-routes.ts


注:本文中的@angular/router.provideRoutes函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。