m_rd_n
m_rd_n

Reputation: 174

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.

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? If so how would you use it in an application? How would you declare or show in routers?

Thank you!

Upvotes: 1

Views: 723

Answers (2)

Selvam Annamalai
Selvam Annamalai

Reputation: 9

  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.

3.Domain feature modules consist mostly of declarations. Only the top component is exported.

domain feature modules reference

4.Domain feature modules rarely have providers. 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.

6.They might be imported by the root AppModule of a small application that lacks routing.

Upvotes: 0

Oleksandr Poshtaruk
Oleksandr Poshtaruk

Reputation: 2146

  1. 'Domain feature module' is not related to url domain. 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:[].

  2. Widget - it is shared module. Has some directives or components, that can be used by other modules components (toaters, scroll directives, etc.

Upvotes: 1

Related Questions