Summary: this tutorial will introduce
you to Feature Modules in angularJS and Types of Feature Modules
Introduction to Feature Modules in angularJS
A feature module is an organizational best practice, as
opposed to a concept of the core Angular API. A feature module delivers a
cohesive set of functionality focused on a specific application need such as a
user workflow, routing, or forms. While you can do everything within the root
module, feature modules help you partition the app into focused areas. A
feature module collaborates with the root module and with other modules through
the services it provides and the components, directives, and pipes.
Types of Feature Modules
There are five general categories of feature modules which
tend to fall into the following groups:
- Domain feature
modules.
- Routed feature
modules.
- Routing modules.
- Service feature
modules.
- Widget feature
modules.
The following table summarizes the key characteristics of
each feature module group.
Feature Module | Declarations | Providers | Exports | Imported by |
---|---|---|---|---|
Domain | Yes | Rare | Top component | Feature, AppModule |
Routed | Yes | Rare | No | None |
Routing | No | Yes (Guards) | RouterModule | Feature (for routing) |
Service | No | Yes | No | AppModule |
Widget | Yes | Rare | Yes | Feature |
If Was this tutorial helpful? so please share by social media
0 comments:
Post a Comment