zoukankan      html  css  js  c++  java
  • [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'
    ])
  • 相关阅读:
    make 实例 一 3463
    python3 中对arrow库的总结(转发)
    impala 导出CSV 或excel
    设置虚拟机IP
    centos7 tomcat9
    eclipse 创建普通maven项目
    java log4j日志配置
    java运行jar命令提示没有主清单属性
    Java 读取 .properties 配置文件
    python 机器学习多项式回归
  • 原文地址:https://www.cnblogs.com/Answer1215/p/4071889.html
Copyright © 2011-2022 走看看