diff --git a/src/ng/directive/ngTransclude.js b/src/ng/directive/ngTransclude.js index 295e47a9922c..86b5ff6100b4 100644 --- a/src/ng/directive/ngTransclude.js +++ b/src/ng/directive/ngTransclude.js @@ -56,23 +56,16 @@ * */ var ngTranscludeDirective = ngDirective({ - controller: ['$element', '$transclude', function($element, $transclude) { + link: function($scope, $element, $attrs, controller, $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)); + '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 - this.$transclude = $transclude; - }], - - link: function($scope, $element, $attrs, controller) { - controller.$transclude(function(clone) { + + $transclude(function(clone) { $element.empty(); $element.append(clone); });