使用Angular 4构建区域的文件结构是什么,就像asp.net

时间:2017-06-02 22:01:13

标签: asp.net angular visual-studio-2015

我正在使用Visual Studio 2015中的Angular 4开发一个商业Web应用程序,这个应用程序根据用户访问,有几个区域可以访问,也就是说,如果用户被授权,他可以访问进入销售区域,购物,会计等,这些"区域"有自己的菜单等 什么是能够满足上述要求的文件结构? 我们的想法是访问您自己的模块和/或组件,就像"区域"使用asp.net mvc,使用angular 4(前端)

1 个答案:

答案 0 :(得分:0)

理想情况下,你会有这样的结构:

app
- shared // shared comp's and pipes
- core // singletons and a module to import into app.module
- user-access // a folder like this for each feature/access level
  - base-component // this would house your router-outlet and navigation
  - components
  - guards // auth guards to prevent access if not authenticated
  - user-access.module.ts // contain routes and declarations for this access group
- app.component.ts
- app.module.ts //etc.