angular.js - What does [] mean in var m = angular.module('hd',[]).
PHPz
PHPz 2017-05-15 17:07:39
0
5
773

What does [] mean in var m = angular.module('hd',[]).

PHPz
PHPz

学习是最好的投资!

reply all(5)
Peter_Zhu
var m = angular.module('hd',[])

means declaring a module called hd. Equivalent to setter, [] represents an array, and the content inside is the other modules that need to be used in the module you are declaring now. For example

var app = angular.module('app',['ionic'])

The above means that a module called app is defined, and the ionic module is injected into the app module

Also

var m = angular.module('hd') 

means to get a module called hd. Equivalent to getter

黄舟
angular.module('app',[]); // 声明一个module,[]里面添加该model的依赖
angular.module('app');    // 获取module
淡淡烟草味

This is a declaration of a moudle.

滿天的星座

Simply put, []的元素为string is the name of another NG module that depends on it.

小葫芦

[] contains the names of the dependent modules you need to use below ['1', '2'...] like this.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template