Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Folder Structure [closed]

I'm confused with the correct structure of my angular application. May i ask for advice for the correct Angular structure of my app? What is the correct structure according to the Angular docs? I'm confused. Thanks. Please see the 2 Angular structure on my image. Do i need to separate the services and models to a different folder?

Structure 1Structure 2

like image 586
Joseph Avatar asked Jun 26 '26 13:06

Joseph


1 Answers

No specific folder structure is "correct". If your application is small and you just have a few components and a single module, I would keep it simple in a flat structure. If there are lot's of modules and components, maybe group components and services in the same folder as the module where they are declared.

In any case the folder structure is not what makes your Angular app work or not, but you should make it in a way that navigating your source files is as easy and readable as possible.

Also see this: https://angular.io/guide/styleguide#flat

like image 80
Peter Salomonsen Avatar answered Jun 28 '26 13:06

Peter Salomonsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!