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

Commit c849098

Browse files
bborowinNarretz
authored andcommitted
docs($compile): clarify when require will throw
To make things less confusing, explicitly state that require WILL NOT throw a compile error if a link function is not specified. Closes #11206 stackoverflow.com/questions/28730346/require-ddo-option-of-angular-directive-does-not-throw-an-error-when-it-should
1 parent 145d397 commit c849098

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ng/compile.js

+2-1
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 no link function
215+
* is 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)