假设我的应用程序结构如下所示:
|-- app
|-- components
|-- features
|-- models
|-- pipes
|-- services
|-- views
Run Code Online (Sandbox Code Playgroud)
现在我已经用一些方法创建了一个常规类,@Output因此几个组件可以扩展这个类。我应该创建一个文件夹“类”吗?我从未在文档或文章中看到过这种情况。
如果它@Output像你所说的那样但它不是一个组件 - 我认为它是供其他组件继承的?在这种情况下,我喜欢将它们称为基础组件,我通常会将它们放在components比继承组件更高的级别中。
例如:
|-- app
|-- components
|-- fancy-table
|-- small-fancy-table
|-- small-fancy-table.component.ts
|-- small-fancy-table.component.html
|-- large-fancy-table
|-- large-fancy-table.component.ts
|-- large-fancy-table.component.html
|-- base-fancy-table.component.ts <-- The class you're referring to.
|-- features
|-- models
|-- pipes
|-- services
|-- views
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2580 次 |
| 最近记录: |