-
Notifications
You must be signed in to change notification settings - Fork 27.3k
docs($compileProvider): document 'require' in angular.Component #14429
Conversation
Note: I was unable to build the doc to test that it works, because the build appears to already be broken: $ grunt package --verbose Reading "Gruntfile.js" Gruntfile...OK <...snip.../> Running "docs" task Aborted due to warnings. |
@@ -1047,6 +1047,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { | |||
* See {@link ng.$compile#-bindtocontroller- `bindToController`}. | |||
* - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled. | |||
* Disabled by default. | |||
* - `require` - `{!Object|undefined}` - requires the controllers of other directives and binds them to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why !Object|undefined
instead of object=
(as other parameters above) ?
Besides, it can be a string or an array as well.
Changed to use '=' instead of '|undefined'. Use 'Object' since 'object' isn't a real Closure type. |
Yeah, casing was not my point. I thought both work (I used |
I don't think it makes sense to pass a string or array here. For a directive, those are used to specify controllers that get injected into the link function. For a component, there is no link function. The object is used to specify a mapping from the required controller to the name that it is bound to on the component's controller. |
I thought you could still use a string or Array to specify depenencies (as in: only use this component inside a XYZ directive etc). As it turns out, these restrictions are only enforced if the required controllers are requested (e.g. in a link function or in controllers for LGTM then 👍 |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
jsdoc update
Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements