Been reading the AngularJS documentation and found some param type
正在阅读AngularJS文档并找到一些param类型
!Array.<string>=
What does this mean? any answer would clear things up.
这是什么意思?任何答案都可以解决问题。
1 个解决方案
#1
1
The operators are from Google Closure's Type Expressions.
运算符来自Google Closure的Type Expressions。
-
!
identifies the type as "Non-nullable." - !将类型标识为“不可为空”。
-
<...>
identifies the type(s) of an object/collection's contents. - <...>标识对象/集合内容的类型。
-
=
identifies the parameter as "Optional." - =将参数标识为“可选”。
So, in the case of angular.module()
:
因此,在angular.module()的情况下:
- No argument has to be given for
requires
. - 对于要求,不必提出任何论据。
- When it is given, it cannot be
null
and must be anArray
containing only string values. - 给定时,它不能为null,并且必须是仅包含字符串值的Array。
angular.module('Foo'); // valid arguments
angular.module('Foo', null); // not valid
angular.module('Foo', ['Bar']); // valid
angular.module('Foo', [false]); // not valid
angular.module('Foo', function(){}); // valid
#1
1
The operators are from Google Closure's Type Expressions.
运算符来自Google Closure的Type Expressions。
-
!
identifies the type as "Non-nullable." - !将类型标识为“不可为空”。
-
<...>
identifies the type(s) of an object/collection's contents. - <...>标识对象/集合内容的类型。
-
=
identifies the parameter as "Optional." - =将参数标识为“可选”。
So, in the case of angular.module()
:
因此,在angular.module()的情况下:
- No argument has to be given for
requires
. - 对于要求,不必提出任何论据。
- When it is given, it cannot be
null
and must be anArray
containing only string values. - 给定时,它不能为null,并且必须是仅包含字符串值的Array。
angular.module('Foo'); // valid arguments
angular.module('Foo', null); // not valid
angular.module('Foo', ['Bar']); // valid
angular.module('Foo', [false]); // not valid
angular.module('Foo', function(){}); // valid