Which type of folder structure should be used with Angular 2?

后端 未结 9 1675
慢半拍i
慢半拍i 2021-01-29 18:45

I am an Angular 1 developer that is starting to learn about Angular 2. There are a lot of different types of folder structure methods depending on the training material. I am

9条回答
  •  日久生厌
    2021-01-29 19:08

    Here's mine

    app
    |
    |-- shared (for html shared between modules)
    |   |
    |   |-- layouts
    |   |   |
    |   |   |-- default
    |   |   |   |-- default.component.ts|html|scss|spec.ts
    |   |   |   |-- default.module.ts
    |   |   |
    |   |   |-- fullwidth
    |   |       |-- fullwidth.component.ts|html|scss|spec.ts
    |   |       |-- fullwidth.module.ts
    |   |
    |   |-- components
    |   |   |-- footer
    |   |   |   |-- footer.component.ts|html|scss|spec.ts
    |   |   |-- header
    |   |   |   |-- header.component.ts|html|scss|spec.ts
    |   |   |-- sidebar
    |   |   |   |-- sidebar.component.ts|html|scss|spec.ts
    |   |
    |   |-- widgets
    |   |   |-- card
    |   |   |-- chart
    |   |   |-- table
    |   |
    |   |-- shared.module.ts
    |
    |-- core (for code shared between modules)
    |   |
    |   |-- services
    |   |-- guards
    |   |-- helpers
    |   |-- models
    |   |-- pipes
    |   |-- core.module.ts
    |
    |-- modules (each module contains its own set)
    |   |
    |   |-- dashboard
    |   |-- users
    |   |-- books
    |       |-- components -> folders
    |       |-- models
    |       |-- guards
    |       |-- books.service.ts
    |       |-- books.module.ts
    |
    |-- material
    |   |-- material.module.ts
    

提交回复
热议问题