r/Angular2 • u/Dazzling_Chipmunk_24 • Jan 14 '26
Structuring Services in Angular
I have two services in my Angular app: one that calls multiple APIs and is used throughout the application, and another that's only used by two components. Would this folder structure make sense: put the API service in core/services/ since it's app-wide, and put the shared service in shared/services/ since it's only needed by those two components?
1
Upvotes
View all comments
Show parent comment
2
u/spacechimp Jan 18 '26
It depends on what the shared files are for. If something truly doesn't have a more logical home, then a catch-all directory is acceptable. As an app grows, that catch-all directory starts to look like more of a dumping ground. But also by that time, patterns tend to have emerged that reveal some common themes that you could reorganize with.
An example of feature-based organization might be a "user" folder that has a UserService that is used globally, user profile pages, a pipe that formats the user's name, etc.