简体   繁体   English

领域特征模块 Angular

[英]Domain Feature Modules Angular

I was learning feature modules in a Angular Official Documentation and I couldn't understand exactly what is a domain feature module.我在Angular 官方文档中学习功能模块,但我无法准确理解什么是领域功能模块。

Can someone explain me in a simpler terms (preferably with real world examples) what is it the domain feature module.有人可以用更简单的术语(最好是真实世界的例子)向我解释什么是领域特征模块。

Is it somehow related to for example dashboard.mydomain.com in mydomain.com?它是否以某种方式与 mydomain.com 中的 dashboard.mydomain.com 相关? If so how would you use it in an application?如果是这样,您将如何在应用程序中使用它? How would you declare or show in routers?您将如何在路由器中声明或显示?

Thank you!谢谢!

  1. 'Domain feature module' is not related to url domain. “域功能模块”与 url 域无关。 It is used for logical split of application (module for user profile implementation, module for admin funtionality, module for main app features (checkout in online shop, showing goods). It implements a specific part (domain) of application. Domain module is imported to main app.module in imports:[].它用于应用程序的逻辑拆分(用于用户配置文件实现的模块,用于管理功能的模块,用于主要应用程序功能的模块(在线商店结帐,展示商品)。它实现应用程序的特定部分(域)。导入域模块到 imports:[] 中的主 app.module。

  2. Widget - it is shared module.小部件 - 它是共享模块。 Has some directives or components, that can be used by other modules components (toaters, scroll directives, etc.有一些指令或组件,可以被其他模块组件(toaters、scroll 指令等)使用。

  1. Domain feature modules deliver a user experience dedicated to a particular application domain like editing a customer or placing an order.域功能模块提供专用于特定应用程序域的用户体验,例如编辑客户或下订单。

2.They typically have a top component that acts as the feature root and private, supporting sub-components descend from it. 2.他们通常有一个顶层组件作为特征根和私有,支持从它下降的子组件。

3.Domain feature modules consist mostly of declarations. 3.领域特征模块主要由声明组成。 Only the top component is exported.仅导出顶部组件。

domain feature modules reference领域特征模块参考

4.Domain feature modules rarely have providers. 4.领域特性模块很少有提供者。 When they do, the lifetime of the provided services should be the same as the lifetime of the module.当他们这样做时,所提供服务的生命周期应该与模块的生命周期相同。

5.Domain feature modules are typically imported exactly once by a larger feature module. 5.领域特征模块通常只被一个更大的特征模块导入一次。

6.They might be imported by the root AppModule of a small application that lacks routing. 6.它们可能由缺少路由的小应用程序的根 AppModule 导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM