I'm migrating an application to standalone components using the following:
ng generate @angular/core:standalone I've already migrated every component to standalone. I now need to remove unnecesary NgModules, which is the second step in the migration guide. Our application uses several different Angular libraries of our own which expose components in the following manner:
const IMPORTS = [ SearcherComponent, SearcherHotelsComponent, SearcherStoreModule, ]; @NgModule({ imports: [...IMPORTS], exports: [...IMPORTS], providers: [provideHttpClient()], }) export class LibSearcherModule {} The fact that we include SearcherStoreModule in LibSearcherModule ties together the ngrx store slice and the searcher components exposed by the library. This means that, if a developer wants to use the searcher, he will be also including the needed store slice automatically.
I need a solution to achieve the same relationship via standalone components. I've come up with importing the following in each exposed component, but it seems cumbersome:
StoreModule.forFeature('SearcherSlice', reducers), EffectsModule.forFeature([SearcherEffects]),