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

后端 未结 9 1674
慢半拍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:25

    I suggest the following structure, which might violate some existing conventions.

    I was striving to reduce name redundancy in the path, and trying to keep naming short in general.

    So there is no/app/components/home/home.component.ts|html|css.

    Instead it looks like this:

    |-- app
        |-- users
            |-- list.ts|html|css
            |-- form.ts|html|css
        |-- cars
            |-- list.ts|html|css
            |-- form.ts|html|css
            |-- configurator.ts|html|css
        |-- app.component.ts|html|css
        |-- app.module.ts
        |-- user.service.ts
        |-- car.service.ts
    |-- index.html
    |-- main.ts
    |-- style.css
    

提交回复
热议问题