上图是父级和子级组件的实现结构。我对有角度的基本文件夹结构有一个想法,但是我需要一些小的说明。下面我提到了我当前创建的结构
app
├── features
│ └── feature 1
│ ├── parent A
│ │ └── parentA.component.ts
│ │
│ ├── parent B
│ │ └── parentB.component.ts
│ │
│ ├── shared
│ │ └── models(models that are using inside the Feature 1)
│ └── core
│ └── service Q
│
├── shared
│ ├── components
│ │ └── header
| └── models(models that are use inside every feature)
└── core
└── service R
我的问题是:
答案1.您可以在父A文件夹下创建子组件,并应为父A文件夹添加路由模块。答案2.是的,如果共享和核心模块的使用仅限于功能模块,那么您绝对可以顺应当前潮流。
app├──特点│└──特征1│├──母A││└──儿童Aa││└──childAa.component.ts││└──儿童Ab││└──childAb.component.ts││└──父A-routing-module.ts│││├──父母B││└──parentB.component.ts│││├──分享了││└──模型(在功能1中使用的模型)│└──核心│└──服务Q│├──分享了│├──零件││└──标题| └──模型(在每个要素中使用的模型)└──核心└──服务R