本文整理汇总了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([])]
});
});
示例2: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TestRouterComponent, AppComponent],
imports: [RouterTestingModule, RouterModule],
providers: [provideRoutes(config)]
});
});
示例3: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent, SidebarMenuComponent, TopNavComponent],
providers: [provideRoutes([])]
});
});
示例4: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent],
providers: [ApiService, provideRoutes([])]
});
});
示例5: beforeEach
beforeEach(async(() => {
addMatchers();
TestBed.configureTestingModule({
imports: [MailModule, RouterTestingModule],
providers: [provideRoutes([])]
});
TestBed.compileComponents();
}));
示例6: main
export function main() {
bootstrap(InboxApp, {
providers: [
provideRoutes(ROUTER_CONFIG),
{provide: LocationStrategy, useClass: HashLocationStrategy}
],
modules: [RouterModule]
});
}
示例7: main
export function main() {
bootstrap(InboxApp, {
providers: [
provideRoutes(ROUTER_CONFIG),
{provide: LocationStrategy, useClass: HashLocationStrategy}
],
declarations: [InboxCmp, DraftsCmp],
imports: [RouterModule]
});
}
示例8: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ RouterTestingModule ],
declarations: [ MyApp, About, Home ],
providers: [
// In RC.6 provideRoutes() will be replaced with
// RouterTestingModule.withRoutes()
provideRoutes(ROUTES)
]
})
});
示例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 }
]
}
})
});
示例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)
];