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

Commit cc17b1b

Browse files
bborowinpkozlowski-opensource
authored andcommitted
docs($compile): clarify behaviour of the require property
To make things less confusing, explicitly state that require WILL NOT cause a compile error if a link function is not specified. Fixes #11198 Closes #11206
1 parent 7cfa79e commit cc17b1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ng/compile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@
211211
* Require another directive and inject its controller as the fourth argument to the linking function. The
212212
* `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the
213213
* injected argument will be an array in corresponding order. If no such directive can be
214-
* found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with:
214+
* found, or if the directive does not have a controller, then an error is raised (unless a link function
215+
* is not specified, in which case error checking is skipped). The name can be prefixed with:
215216
*
216217
* * (no prefix) - Locate the required controller on the current element. Throw an error if not found.
217218
* * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.

0 commit comments

Comments
 (0)