https://angular.io/docs/ts/latest/guide/style-guide.html#!#04-06
Ben Redux (veya ngrx/mağaza) uygulamaya istiyorsanız Yeni Angular 4 projeme, başvurumu bu şekilde yapılandırmak daha iyi olur mu?
project root ├── src/ │ ├── app/ │ │ ├──stores/ │ │ │ ├── heros/ │ │ │ │ ├── heros.actions.ts|reducer|effects|store.ts │ │ │ │ │ │ │ │── ..../ │ │ │ │ ├── ..... │ │ │ │ │ ├── containers/ │ │ │ ├── heros/ │ │ │ │ ├── heros.component.ts|html|css|spec.ts │ │ │ │ │ └── ...... │ │ │ │ │ │ │ │ ├── components/ │ │ │ ├── hero-list/ │ │ │ │ │ ├── hero-list.component.ts|html|css|spec.ts │ │ │ │ │ └── ....... │ │ │ ├── .... I have been using second structure but as my app grows, it was getting difficult to maintain, and then I refactored the structure in this way, the plus point of this structure is, if in future you decide to remove or edit ngrx all you need to do is remove or edit the stores folder. Note: - containers folder hold my smart components - components folder hold my dumb components
Ya ngrx/mağazanın örneğini (https://github.com/ngrx/example-app), bu şekilde uygulamayı yapılandırmaya izleyin?
project root ├── src/ │ ├── app/ │ │ ├── actions/ │ │ │ ├── hero.js │ │ │ ├── hero-list.js │ │ │ └── ...... │ │ ├── reducers/ │ │ │ ├── hero.js │ │ │ ├── hero-list.js │ │ │ └── ...... │ │ ├── components/ │ │ │ ├── heros/ │ │ │ │ ├── hero/ │ │ │ │ │ ├── hero-list.component.ts|html|css|spec.ts │ │ │ │ │ └── ...... │ │ │ │ ├── hero-list/ │ │ │ │ │ ├── hero-list.component.ts|html|css|spec.ts │ │ │ │ │ └── ...... │ │ │ ├── ......
Başka herhangi bir daha iyi yapı var mı?
Ya kullanımı uygulaması/veya src benim akıllı bileşenleri
bileşenleri klasörü tutun tutun .. (src/app2, src/app3'e sahip değilseniz ve bu durumda, bu uygulamaları ayrı depolara ayırmadan src/app mantıklı değildir) –
Bunu ilk yoldan yaparım, ama sadece kişisel p Referans/görüşü. Bu yüzden yakın oy. – cartant
Gelecekte, özellik modülleri kendi redüktörlerini ekleyebilecekler. Bu nedenle, her modülde ''/app/feature/store'' için bir dirim var ve 'feature.actions.ts',' feature.reducer.ts' ve 'feature.selectors.ts' içerir. – adharris