Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Conversation

ademuri
Copy link
Contributor

@ademuri ademuri commented Apr 13, 2016

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

@ademuri
Copy link
Contributor Author

ademuri commented Apr 13, 2016

Note: I was unable to build the doc to test that it works, because the build appears to already be broken:

$ grunt package --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

<...snip.../>

Running "docs" task
[14:08:13] Working directory changed to ~/angular/angular.js/docs
[14:08:14] Using gulpfile ~/angular/angular.js/docs/gulpfile.js
[14:08:14] Starting 'bower'...
[14:08:14] Starting 'build-app'...
[14:08:14] Finished 'bower' after 372 ms
[14:08:14] Starting 'assets'...
[14:08:15] Starting 'doc-gen'...
error: Error processing docs: TypeError: object is not a function
at Function.v.extend.async (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/validate.js/validate.js:196:14)
at /usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/lib/Dgeni.js:166:23
at _fulfilled (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:796:13)
at /usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:857:14
at runSingle (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:137:13)
at flush (/usr/local/google/home/ademuri/angular/angular.js/node_modules/dgeni/node_modules/q/q.js:125:13)
at process._tickCallback (node.js:415:13)
Warning: doc generation failed Use --force to continue.

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
Copy link
Member

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.

@ademuri
Copy link
Contributor Author

ademuri commented Apr 14, 2016

Changed to use '=' instead of '|undefined'.

Use 'Object' since 'object' isn't a real Closure type.

@gkalpak
Copy link
Member

gkalpak commented Apr 14, 2016

Yeah, casing was not my point. I thought both work (I used object for consistency).
In any case, Object is not the only permitted type. It can also be either a string or an Array.

@ademuri
Copy link
Contributor Author

ademuri commented Apr 14, 2016

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.

See https://docs.angularjs.org/guide/component

@gkalpak
Copy link
Member

gkalpak commented Apr 14, 2016

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 require: {}).
Since components can't have a link function, string or Array requires are passed to the DDO, but have no effect, so they are essentially ignored.

LGTM then 👍

gkalpak pushed a commit that referenced this pull request Apr 14, 2016
@gkalpak gkalpak closed this in 1f05b96 Apr 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants