diff options
Diffstat (limited to 'src/ng/directive/ngTransclude.js')
| -rw-r--r-- | src/ng/directive/ngTransclude.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ng/directive/ngTransclude.js b/src/ng/directive/ngTransclude.js index d7c9cd44..490ea21f 100644 --- a/src/ng/directive/ngTransclude.js +++ b/src/ng/directive/ngTransclude.js @@ -52,7 +52,15 @@ * */ var ngTranscludeDirective = ngDirective({ - controller: ['$transclude', function($transclude) { + controller: ['$element', '$transclude', function($element, $transclude) { + if (!$transclude) { + throw minErr('ngTransclude')('orphan', + 'Illegal use of ngTransclude directive in the template! ' + + 'No parent directive that requires a transclusion found. ' + + 'Element: {0}', + startingTag($element)); + } + // remember the transclusion fn but call it during linking so that we don't process transclusion before directives on // the parent element even when the transclusion replaces the current element. (we can't use priority here because // that applies only to compile fns and not controllers |
