Platform: Lazy loading scenario

Created on 11 Sep 2017  路  1Comment  路  Source: ngrx/platform

Hi i got a small question pertaining to ngrx i have two lazy loaded modules and i have a scenario where i have aonther third module named shared and i want these two modules to have access to the store that i want to put in the shared module. do you have any ideas how i can make this work.

Store question

Most helpful comment

The Store isn't something you put in a shared module to include in your feature modules. You only need register the Store using StoreModule.forRoot in the root NgModule, and then the Store service is available globally. Then any modules whether loaded lazily or not will be able inject the Store and have access to the global state.

>All comments

The Store isn't something you put in a shared module to include in your feature modules. You only need register the Store using StoreModule.forRoot in the root NgModule, and then the Store service is available globally. Then any modules whether loaded lazily or not will be able inject the Store and have access to the global state.

Was this page helpful?
0 / 5 - 0 ratings