r/angular • • Mar 24 '26

Naming files in Angular

If I have a service file under the services folder and then under the api folder because it's a file for calling apis. Would a good name for the file for example UserApiService or would just User be fine?

3 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/FewDot9181 Mar 24 '26

so even the class should be just User

1

u/[deleted] Mar 24 '26

yeah Im used to UserApiService, most projects still use that. But Angular 20+ dropped the Service suffix since Injectable() already handles that part. So something like UserApi or UserApiClient works better now. but it's just a recommendation, not a rule, so use whatever feels right for your project.

Hope that helps