diff options
| author | jankuca | 2013-09-25 16:37:59 -0700 |
|---|---|---|
| committer | Brian Ford | 2013-09-30 16:44:19 -0700 |
| commit | 5a1a6b86a8dbcd8aa4fe9c59fad8d005eead686c (patch) | |
| tree | 451269b873ad3a603dcc414b6bcc637ff9c89bd1 /src | |
| parent | 742271ffa3a518d9e8ef2cb97c24b45b44e3378d (diff) | |
| download | angular.js-5a1a6b86a8dbcd8aa4fe9c59fad8d005eead686c.tar.bz2 | |
fix(ngTransclude): detect ngTranslude usage without a transclusion directive
Closes #3759
Diffstat (limited to 'src')
| -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 |
