本文整理匯總了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)
];