provideRouter
함수
안정화
Sets up providers necessary to enable Router functionality for the application.
Allows to configure a set of routes as well as extra features that should be enabled.
사용 시 참고사항
Basic example of how you can add a Router to your application:
const appRoutes: Routes = [];
bootstrapApplication(AppComponent, {
providers: [provideRouter(appRoutes)]
});
You can also enable optional features in the Router by adding functions from the RouterFeatures
type:
const appRoutes: Routes = [];
bootstrapApplication(AppComponent,
{
providers: [
provideRouter(appRoutes,
withDebugTracing(),
withRouterConfig({paramsInheritanceStrategy: 'always'}))
]
}
);
상세 내용으로 이동