From 7b2a02d94b31cc5d0554d03877cbae5bebd1b8d8 Mon Sep 17 00:00:00 2001 From: bborowin Date: Fri, 27 Feb 2015 11:01:03 -0500 Subject: [PATCH] Updated the require section to reflect issue 11198 To make things less confusing, explicitly state that require WILL NOT cause a compile error if a link function is not specified. https://github.com/angular/angular.js/issues/11198 stackoverflow.com/questions/28730346/require-ddo-option-of-angular-directive-does-not-throw-an-error-when-it-should --- src/ng/compile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index f97c780d7061..5342227b51a1 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -211,7 +211,8 @@ * Require another directive and inject its controller as the fourth argument to the linking function. The * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the * injected argument will be an array in corresponding order. If no such directive can be - * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with: + * found, or if the directive does not have a controller, then an error is raised (unless a link function + * is not specified, in which case error checking is skipped). The name can be prefixed with: * * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.