国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

angular.module()

2024-04-27 15:06:23
字體:
來源:轉載
供稿:網友

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.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 翼城县| 定兴县| 海兴县| 集贤县| 广灵县| 大荔县| 横峰县| 襄樊市| 博白县| 安塞县| 荆门市| 南开区| 黎城县| 兴义市| 东宁县| 广宁县| 澜沧| 闵行区| 湛江市| 从江县| 临沧市| 城市| 襄樊市| 衡东县| 赫章县| 三门峡市| 萨嘎县| 邵东县| 营口市| 嵊泗县| 前郭尔| 五华县| 手游| 枣阳市| 英吉沙县| 遂川县| 牙克石市| 固阳县| 德令哈市| 清苑县| 兴文县|