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.
我有个问题。我有一些组件希望能够添加到我的应用程序中。我不会从一开始就加载所有这些组件,而是按需加载(延迟加载)。
例如,我有这个组件,我只想在某些页面中添加。但不是负载。
共享模块是正确的地方吗?我必须从 app.module 加载它吗?
如果您有多次重复使用的组件,那当然应该转到共享模块。除非它是服务,否则服务不应该在共享模块中。