What does [] mean in var m = angular.module('hd',[]).
天蓬老师2017-05-15 17:09:39
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
黄舟2017-05-15 17:09:39
angular.module('app',[]); // 声明一个module,[]里面添加该model的依赖
angular.module('app'); // 获取module
滿天的星座2017-05-15 17:09:39
Simply put, []
的元素为string
is the name of another NG module that depends on it.
高洛峰2017-05-15 17:09:39
[] contains the names of the dependent modules you need to use below ['1', '2'...] like this.