For example: I have a StatesService. It returns all states of a country, but It doesn't have its own view.
In "Folder-by-feature" https://github.com/johnpapa/angular-styleguide/tree/master/a1#folders-by-feature-structure, It can see a 'services' folder, but not in image below.
For moment, I'm using an "extra" folder to put services with no controllers nor views.
@johnpapa
I have a services
directory that stores all of my common services.
Personally, I wouldn't put it in a "core service" file, because that seems like it would violate the Rule of 1 (Y001).
Services don't relate to one View, they relate to a service or set of actions that they help provide for an app. So your scenario is quite common. You're already more than half way there :)
First we decide if we have the need for a service. You already did that with determining it handles state.
Then we decide how to extract ust that logic. You did that too!
Then we decide who needs it. Is it used by 1 controller? 1 service? 1 directive? Are they all in 1 feature/module? If used by one module I put it in that module. If used across the app, put it in a shared module.
Good luck
Most helpful comment
Services don't relate to one View, they relate to a service or set of actions that they help provide for an app. So your scenario is quite common. You're already more than half way there :)
First we decide if we have the need for a service. You already did that with determining it handles state.
Then we decide how to extract ust that logic. You did that too!
Then we decide who needs it. Is it used by 1 controller? 1 service? 1 directive? Are they all in 1 feature/module? If used by one module I put it in that module. If used across the app, put it in a shared module.
Good luck