头图

Check where this string constant is used:

(1) Define the State data structure:

(2) Used to create a feature selector, and pass in ROUTING_FEATURE as an input parameter: feature name

(3) In routing.module.ts, as input parameters of StoreModule.forFeature and StoreRouterConnectingModule.

For scenario 3, let's look at the data details of the type ModuleWithProviders returned by the StoreModule.forFeature call.

When each module is imported, it will execute the executable code in its ts code:

Data returned by storeModule.forFeature:

Can I use these providers in other modules?

The second parameter of forFeature must be reducer, the type is ActionReducerMap or the injection type of ActionReducerMap:

Spartacus chose the latter:

More original articles by Jerry, all in: "Wang Zixi":


注销
1k 声望1.6k 粉丝

invalid