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'
])

[Angular-Scaled web] 2. Architecture sub-modules的更多相关文章

  1. 混合开发 Hybird Ionic Angular Cordova web 跨平台 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  2. What is Web Application Architecture? How It Works, Trends, Best Practices and More

    At Stackify, we understand the amount of effort that goes into creating great applications. That’s w ...

  3. vue,react,angular三大web前端流行框架简单对比

    常用的到的网站 vue学习库: https://github.com/vuejs/awesome-vue#carousel (json数据的格式化,提高本地测试的效率) json在线编辑: http: ...

  4. Understanding Spring Web Application Architecture: The Classic Way--转载

    原文地址:http://www.petrikainulainen.net/software-development/design/understanding-spring-web-applicatio ...

  5. 开始在web中使用JS Modules

    本文由云+社区发表 作者: 原文:<Using JavaScript modules on the web> https://developers.google.com/web/funda ...

  6. Translate Angular >=4 with ngx-translate and multiple modules

    原文:https://medium.com/@lopesgon/translate-angular-4-with-ngx-translate-and-multiple-modules-7d9f0252 ...

  7. BUILDING ANGULAR APPS USING FLUX ARCHITECTURE

    Flux is an architectural pattern based on unidirectional data flow. Although it is originated in the ...

  8. angular模拟web API

    现象:angular Cannot find module 'angular-in-memory-web-api'报错找不动“angular-in-memory-web-api”模块 解决:1.控制台 ...

  9. [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 in ...

随机推荐

  1. PHP 笔记——文件引用

    1. 文件路径 "文件路径"指的是被包含文件所在的绝对路径或相对路径. 在相对路径中,"./"表示当前目录,"../"表示当前目录的上级目录 ...

  2. Codeforces Round #463

    A - Palindromic Supersequence /* 题目大意:给出一个串,构造一个包含该串的回文串 */ #include <cstdio> #include <alg ...

  3. bzoj 2555

    暴力. 收获: 1.第一道后缀自动机,大概知道怎么写了,有一些原理性的东西还要理解. 2.计算right集合的大小 /***************************************** ...

  4. Python学习笔记(一):Python基础学习

    总结的内容: 1.变量的命名 2.脚本的注释 3.运算符 4.用户输入语句 一.变量的命名 1.变量用于引用在程序中可能会变化的值.它们被称为变量是因为它们可能引用存储在内存中的不同的值. 2.变量的 ...

  5. 对于asp.net mvc异步查询

    如何做MVC异步查询,做列表页面. 查询是项目中必不可少的工作,而且不同的项目不同的团队,都有自己的简单方法.Asp.net mvc 有自己独特的优势,下面是结合mvc实现一个产品列表的Demo. 问 ...

  6. JavaScript Promises

    上篇文章介绍了JavaScript异步机制,请看这里. JavaScript异步机制带来的问题 JavaScript异步机制的主要目的是处理非阻塞,在交互的过程中,会需要一些IO操作(比如Ajax请求 ...

  7. ASP.NET Web API教程 分页查询

    首先增加支持分页的API方法 public IEnumerable<UserInfo> GetUserInfos(int pageindex, int size)         {    ...

  8. erlang 中文社区 下载

    http://www.cnerlang.com/download/     erlang 下载 http://www.blogjava.net/killme2008/archive/2007/06/1 ...

  9. java基础学习总结——接口

    一.接口的概念 JAVA是只支持单继承的,但现实之中存在多重继承这种现象,如“金丝猴是一种动物”,金丝猴从动物这个类继承,同时“金丝猴是一种值钱的东西”,金丝猴从“值钱的东西”这个类继承,同时“金丝猴 ...

  10. OS X 10.10.4系统,命名为“Yosemite”(优胜美地)

    新版OS X 10.10.4系统,命名为“Yosemite”(优胜美地),拥有全新的界面设计及一些功能更新,下面一起来了解一下. 一.界面扁平化.进一步融入iOS功能 首先,OS X 10.10 Yo ...