angular.module()
来源:互联网 发布:rap编曲知乎 编辑:程序博客网 时间:2024/06/08 07:41
angular.module()创建、获取、注册angular中的模块
The angular.module()
is a global place for creating, registering and retrieving Angular modules.When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module
) is retrieved。
// 传递参数不止一个,代表新建模块;空数组代表该模块不依赖其他模块var createModule = angular.module("myModule", []);// 只有一个参数(模块名),代表获取模块// 如果模块不存在,angular框架会抛异常var getModule = angular.module("myModule");// true,都是同一个模块alert(createModule == getModule);
该函数既可以创建新的模块,也可以获取已有模块,是创建还是获取,通过参数的个数来区分。
angular.module(name, [requires], [configFn]);
name:字符串类型,代表模块的名称;
requires:字符串的数组,代表该模块依赖的其他模块列表,如果不依赖其他模块,用空数组即可;
configFn:用来对该模块进行一些配置。
现在我们知道如何创建、获取模块了,那么模块究竟是什么呢?官方的Developer Guide上只有一句话:You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc.
0 0
- angular.module()
- AngularJs angular.injector、angular.module
- angular中的module
- angular.module参数详解
- ionic/angular中module探秘
- Angular入门-module和service
- angular源码一,module加载器
- AngularJs angular.Module模块接口配置
- 先执行angular.module 然后执行ngApp
- Angular Module声明和获取重载
- Angular入门02- Module模块、Controller控制器
- angular学习(十四)——Module
- Angular Module声明和获取重载
- can not find module @angular/animations/browser
- AngularJS 模块定义应用 angular.module
- Angular CLI ng g module 参数
- 理解angular中的module和injector,即依赖注入
- angular中的module和injector,即依赖注入
- activity的退出功能
- 浏览器后退时重置input值
- C语言编写cgi程序hello world
- linux内核线程 [实现2]
- Codeforces 672D Robin Hood【思维+二分】这题思路有点劲啊
- angular.module()
- C语言字符串中大小写字母转换
- jquery笔记:load, $.get, $.getJSON,$.getScript,$.post,serialize(),serializeArray
- 在Ubuntu 14.04 64bit中永久添加DNS的方法;虚拟机与windows互相都可以ping通,但是ubuntu 就是ping不通www.baidu.com;找了N久,最后找到有效的办法
- React-Native初接触
- 设计模式——责任链模式
- KMP算法模板
- centos 安装 eclipse
- nginx的虚拟主机配置