[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
- create
- bookmarks
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
- models
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的更多相关文章
- 混合开发 Hybird Ionic Angular Cordova web 跨平台 MD
Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...
- 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 ...
- vue,react,angular三大web前端流行框架简单对比
常用的到的网站 vue学习库: https://github.com/vuejs/awesome-vue#carousel (json数据的格式化,提高本地测试的效率) json在线编辑: http: ...
- Understanding Spring Web Application Architecture: The Classic Way--转载
原文地址:http://www.petrikainulainen.net/software-development/design/understanding-spring-web-applicatio ...
- 开始在web中使用JS Modules
本文由云+社区发表 作者: 原文:<Using JavaScript modules on the web> https://developers.google.com/web/funda ...
- Translate Angular >=4 with ngx-translate and multiple modules
原文:https://medium.com/@lopesgon/translate-angular-4-with-ngx-translate-and-multiple-modules-7d9f0252 ...
- BUILDING ANGULAR APPS USING FLUX ARCHITECTURE
Flux is an architectural pattern based on unidirectional data flow. Although it is originated in the ...
- angular模拟web API
现象:angular Cannot find module 'angular-in-memory-web-api'报错找不动“angular-in-memory-web-api”模块 解决:1.控制台 ...
- [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 ...
随机推荐
- [BZOJ4570][SCOI2016]妖怪(凸包)
两种做法,前一种会TLE. 第一种是高一数学题做法,设一个妖怪的atk和dnf分别为x和y,则它在(a,b)环境下的战斗力为x+y/a*b+y+x/a*b. 设t为b/a,则战斗力即$f(x,y,t) ...
- C语言学习常见错误分析
错误分类 语法错 逻辑错 运行错 0.忘记定义变量: int main() { x=3;y=6; printf("%d/n",x+y); } 1.C语言的变量一定要先定义 ...
- Android中利用ant进行多渠道循环批量打包
公司负责Android开发的小伙伴学习能力稍微偏弱,交代给他的自动化打包的任务,弄了好久依然没有成效.无奈只好亲自出手. 没有想到过程很顺利,我完全按照如下文章的步骤进行: 主要参考: Android ...
- 【洛谷】2324:[SCOI2005]骑士精神【IDA*】
P2324 [SCOI2005]骑士精神 题目描述 输入输出格式 输入格式: 第一行有一个正整数T(T<=10),表示一共有N组数据.接下来有T个5×5的矩阵,0表示白色骑士,1表示黑色骑士,* ...
- Android 中点击返回键弹出“在按一次退出程序”的做法
在很多应用中都有这种做法,连续点击两次才退出程序,目的是为了防止用户不小心点击到了返回键而退出程序了,添加了一次用户确认的过程. 其实做法很简单,只需要做一个延时的消息处理就可以了. 首先在我们在一个 ...
- Git_工作区和暂存区
Git和其他版本控制系统如SVN的一个不同之处就是有暂存区的概念. 先来看名词解释. 工作区(Working Directory):就是你在电脑里能看到的目录,比如我的learngit文件夹就是一个工 ...
- 关于OPC Client 编写2
最近在搞到一个OPC动态库OPCAutomation.dll,该动态库在http://www.kepware.com/可下载,下面介绍如何用C#进行OPC Client开发. 1.新建C#应用程序,命 ...
- 用最简单的例子理解对象为Null模式(Null Object Pattern)
所谓的"对象为Null模式",就是要求开发者考虑对象为Null的情况,并设计出在这种情况下的应对方法. 拿"用最简单的例子理解策略模式(Strategy Pattern) ...
- extjs 动态设定 DateField 最大值 最小值
yxrqDate.minValue = new Date();yxrqDate.maxValue = new Date(9000,1,1);yxrqDate.validate(); //var pic ...
- Juce源代码分析(一)Juce的优势
为什么学习Juce JUCE (Jules' Utility Class Extensions)是由Raw MaterialSoftware公布的一套基于c++的跨平台应用程序框架类库(Windows ...