• [Angular-Scaled web] 2. Architecture sub-modules



    Common models will be a sub models for category and bookmarks. Because they are used everywhere.

    For bookmarks edit and create, all they need is a common sub module.

    bookmarks.js needs create and edit modules and two common sub modules.

    category.js needs common categories sub module.

     Then in start.js, we include two main features: categories and bookmarks modules.

    app

    • category
      • bookmarks
        • create
          • bookmarks-create.js
    angular.module('categories.bookmarks.create', [
      'eggly.models.bookmarks'
    ])
          • bookmarks-create.tmpl.html
        • edit
          • bookmarks-edit.js
    angular.module('categories.bookmarks.edit', [
      'eggly.models.bookmarks'
    ])
          • bookmarks-edit.tmpl.html
        • bookmarks.js
    angular.module('categories.bookmarks', [
      'categories.bookmarks.edit',  //bookmarks for edit
      'categories.bookmarks.create',  //bookmarks for create
      'eggly.models.categories',   //common model for categories
      'eggly.models.bookmarks'  //common model for bookmarks
    ]);
        • bookmarks.tmpl.html
      • category.js
    angular.module('categories', [
      'eggly.models.categories' //add common models for categories
    ])
      • category.tmpl.html
    • common
      • models
        • category-model.js
    angular.module('eggly.models.categories', []);
        • bookmarks-model.js
    angular.module('eggly.models.categories', []);
    • app.start.js
    angular.module('Eggly', [
        'categories',  // all models included by categories will also be transfered to main model
        'categories.bookmarks'
    ])
  • 相关阅读:
    一个php soap的错误记录
    Android 开发有哪些新技术出现?
    每个PHP开发者都应该看的书
    30 个 PHP 的 Excel 处理类
    PHP Session可能会引起并发问题
    PHP代码优化技巧大盘点
    分析和解析PHP代码的7大工具
    关于 PHP 7 你必须知道的五件事
    PHP也20岁了
    PHP高级特性二之文件处理
  • 原文地址:https://www.cnblogs.com/Answer1215/p/4071889.html
Copyright © 2020-2023  润新知