在Angular应用程序中放置常规课程的位置?

时间:2018-01-25 19:27:16

标签: angular

假设我的应用程序结构如下:

|-- app
    |-- components
    |-- features
    |-- models
    |-- pipes
    |-- services
    |-- views

现在我已经使用一些方法和@Output定期上课,这样几个组件可以扩展这个类。我应该创建一个文件夹" classes"?我在文档或文章中从未见过这个。

2 个答案:

答案 0 :(得分:1)

您已有模特文件夹,您可以根据需要创建 interface/class

答案 1 :(得分:0)

如果它有@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
相关问题