Skip to content

Commit 5d8077f

Browse files
committed
updated modularity to reflect reusable modules across applications
1 parent d541c42 commit 5d8077f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,20 +2116,22 @@ While this guide explains the *what*, *why* and *how*, I find it helpful to see
21162116
### Module Dependencies
21172117
###### [Style [Y165](#style-y165)]
21182118
2119-
- The application root module depends on the app specific feature modules, the feature modules have no direct dependencies, the cross-application modules depend on all generic modules.
2119+
- The application root module depends on the app specific feature modules and any shared or reusable modules.
21202120
21212121
![Modularity and Dependencies](https://raw.githubusercontent.com/johnpapa/angularjs-styleguide/master/assets/modularity-1.png)
21222122
21232123
*Why?*: The main app module contains a quickly identifiable manifest of the application's features.
21242124
2125-
*Why?*: Cross application features become easier to share. The features generally all rely on the same cross application modules, which are consolidated in a single module (`app.core` in the image).
2125+
*Why?*: Each feature area contains a manifest of what it depends on, so it can be pulled in as a dependency and still work.
21262126
21272127
*Why?*: Intra-App features such as shared data services become easy to locate and share from within `app.core` (choose your favorite name for this module).
21282128
21292129
Note: This is a strategy for consistency. There are many good options here. Choose one that is consistent, follows AngularJS's dependency rules, and is easy to maintain and scale.
21302130
21312131
> My structures vary slightly between projects but they all follow these guidelines for structure and modularity. The implementation may vary depending on the features and the team. In other words, don't get hung up on an exact like-for-like structure but do justify your structure using consistency, maintainability, and efficiency in mind.
21322132
2133+
> In a small app, you can also consider putting all the shared dependencies in the app module where the feature modules have no direct dependencies. This makes it easier to maintain the smaller application, but makes it harder to reuse modules outside of this application.
2134+
21332135
**[Back to top](#table-of-contents)**
21342136
21352137
## Startup Logic

assets/modularity-1.png

156 KB
Loading

0 commit comments

Comments
 (0)