Skip to content

Commit

Permalink
feat(router-store): Make usage of forRoot required (ngrx#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoVogt committed Mar 31, 2019
1 parent 78e237c commit ae28589
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions modules/router-store/src/router_store_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,31 +122,15 @@ enum RouterTrigger {
* { path: '', component: SimpleCmp },
* { path: 'next', component: SimpleCmp }
* ]),
* StoreRouterConnectingModule
* StoreRouterConnectingModule.forRoot()
* ],
* bootstrap: [AppCmp]
* })
* export class AppModule {
* }
* ```
*/
@NgModule({
providers: [
{
provide: _ROUTER_CONFIG,
useValue: {},
},
{
provide: ROUTER_CONFIG,
useFactory: _createRouterConfig,
deps: [_ROUTER_CONFIG],
},
{
provide: RouterStateSerializer,
useClass: DefaultRouterStateSerializer,
},
],
})
@NgModule()
export class StoreRouterConnectingModule {
static forRoot<
T extends BaseRouterStoreState = SerializedRouterStateSnapshot
Expand All @@ -157,6 +141,11 @@ export class StoreRouterConnectingModule {
ngModule: StoreRouterConnectingModule,
providers: [
{ provide: _ROUTER_CONFIG, useValue: config },
{
provide: ROUTER_CONFIG,
useFactory: _createRouterConfig,
deps: [_ROUTER_CONFIG],
},
{
provide: RouterStateSerializer,
useClass: config.serializer
Expand Down

0 comments on commit ae28589

Please sign in to comment.