Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
想要实现共享存储模块以在 2 个功能模块之间共享状态有人可以共享 stackblitz 或 git repo 链接以共享状态模块
导入的模块的所有导入模块都可以访问商店StoreModule.forRoot。
StoreModule.forRoot
因此,如果您StoreModule.forRoot的AppModule, 那么任何延迟加载的模块都可以执行this.store.select(SELECTOR),或者this.store.dispatch(ACTION)它会返回数据并按照您的预期导致更改。
AppModule
this.store.select(SELECTOR)
this.store.dispatch(ACTION)