【发布时间】:2020-04-12 16:51:29
【问题描述】:
上图是父子组件的实现结构。 我对角度基本文件夹结构有一个想法,但我需要一些小的说明。下面我提到了我目前创建的结构
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
我的问题是:
- 在哪里创建子组件?
- 我也在功能内部使用共享文件夹和核心文件夹,对吗?
【问题讨论】:
-
“我也在 features 中使用 shared 和 core 文件夹”,将组件放在 shared 中的真正原因是在任何你想要的地方使用它们,所以这样做是可以的。
标签: angular module model parent-child directory-structure