当前位置: 首页>>代码示例>>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;未经允许,请勿转载。