Which type of folder structure should be used with Angular 2?
Solution 1:
The official guideline is there now. mgechev/angular2-seed
had alignment with it too. see #857.
https://angular.io/guide/styleguide#overall-structural-guidelines
Solution 2:
I think structuring the project by functionalities is a practical method. It makes the project scalable and maintainable easily. And it makes each part of the project working in a total autonomy. Let me know what you think about this structure below: ANGULAR TYPESCRIPT PROJECT STRUCTURE – ANGULAR 2
source : http://www.angulartypescript.com/angular-typescript-project-structure/
Solution 3:
I am going to use this one. Very similar to third one shown by @Marin.
app
|
|___ images
|
|___ fonts
|
|___ css
|
|___ *main.ts*
|
|___ *main.component.ts*
|
|___ *index.html*
|
|___ components
| |
| |___ shared
| |
| |___ home
| |
| |___ about
| |
| |___ product
|
|___ services
|
|___ structures
Solution 4:
So after doing more investigating I ended up going with a slightly revised version of Method 3 (mgechev/angular2-seed).
I basically moved components to be a main level directory and then each feature will be inside of it.