zoukankan      html  css  js  c++  java
  • [Angular-Scaled web] 1. Architecture and file structure

    We build a project according to its features or based on simple MVC structure. Put all controller into one folder and factory into another folder is hard to maintain and testing.

    For this project, we have two main features

    1. Category
    2. Bookmark

    And one Category contains serveal bookmarks. 

    For bookmarks, we can do 'edit', 'create' options.

    We should also isolate one common model, in which we place something can be used for all other modules.

    The stucture should be:

    app

    • category
      • bookmarks
        • create
          • bookmarks-create.js
          • bookmarks-create.tmpl.html
        • edit
          • bookmarks-edit.js
          • bookmarks-edit.tmpl.html
        • bookmarks.js
        • bookmarks.tmpl.html
      • category.js
      • category.tmpl.html
    • common
      • models
        • category-model.js
        • bookmarks-model.js
    • app.complete.js
    • app.start.js
    • app.finish.js

    assets  //where to put css and image files

    • css
    • images

    data // where to store the json files

    • bookmarks.json
    • categories.json

    vendor //where to store extension js files

    • angular-ui-router.min.js

    app.complete.html

    app.start.html

    app.finish.html

  • 相关阅读:
    C++ 类
    百练3383:Cell Phone Network
    百练4092:牛仔裤
    百练4091:最近餐馆
    百练4090:超级备忘录
    百练2868:牛顿迭代
    百练2812:恼人的青蛙
    百练2805:正方形
    bzoj1856 [Scoi2010]字符串
    bzoj2096 [Poi2010]Pilots
  • 原文地址:https://www.cnblogs.com/Answer1215/p/4071843.html
Copyright © 2011-2022 走看看