fix(router): fix offline compilation by exporting provideLocationStrategy

This commit is contained in:
vsavkin 2016-08-01 15:51:22 -07:00
parent 4624a35845
commit 8dc82a0080
1 changed files with 3 additions and 3 deletions

View File

@ -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);