fix(router): fix offline compilation by exporting provideLocationStrategy
This commit is contained in:
parent
4624a35845
commit
8dc82a0080
|
@ -87,8 +87,8 @@ export class RouterModule {
|
||||||
return {
|
return {
|
||||||
ngModule: RouterModule,
|
ngModule: RouterModule,
|
||||||
providers: [
|
providers: [
|
||||||
ROUTER_PROVIDERS, provideRoutes(routes), {provide: ROUTER_CONFIGURATION, useValue: config},
|
ROUTER_PROVIDERS, provideRoutes(routes),
|
||||||
{
|
{provide: ROUTER_CONFIGURATION, useValue: config ? config : {}}, {
|
||||||
provide: LocationStrategy,
|
provide: LocationStrategy,
|
||||||
useFactory: provideLocationStrategy,
|
useFactory: provideLocationStrategy,
|
||||||
deps: [
|
deps: [
|
||||||
|
@ -104,7 +104,7 @@ export class RouterModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function provideLocationStrategy(
|
export function provideLocationStrategy(
|
||||||
platformLocationStrategy: PlatformLocation, baseHref: string, options: ExtraOptions = {}) {
|
platformLocationStrategy: PlatformLocation, baseHref: string, options: ExtraOptions = {}) {
|
||||||
return options.useHash ? new HashLocationStrategy(platformLocationStrategy, baseHref) :
|
return options.useHash ? new HashLocationStrategy(platformLocationStrategy, baseHref) :
|
||||||
new PathLocationStrategy(platformLocationStrategy, baseHref);
|
new PathLocationStrategy(platformLocationStrategy, baseHref);
|
||||||
|
|
Loading…
Reference in New Issue