setupTestingRouter

Router setup factory function used for testing.

setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location, loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy)

参数

urlSerializer

Type: UrlSerializer.

contexts

Type: ChildrenOutletContexts.

location

Type: Location.

loader

Type: NgModuleFactoryLoader.

compiler

Type: Compiler.

injector

Type: Injector.

routes

Type: Route[][].

opts

Type: ExtraOptions | UrlHandlingStrategy.

可选. 默认值是 undefined.

urlHandlingStrategy

Type: UrlHandlingStrategy.

可选. 默认值是 undefined.