'use strict'; /** * @ngdoc directive * @name ng.directive:ngTransclude * @restrict AC * * @description * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. * * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted. * * @element ANY * * @example


{{text}}
it('should have transcluded', function() { input('title').enter('TITLE'); input('text').enter('TEXT'); expect(binding('title')).toEqual('TITLE'); expect(binding('text')).toEqual('TEXT'); });
* */ var ngTranscludeDirective = ngDirective({ controller: ['$transclude', function($transclude) { // 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) { $element.html(''); $element.append(clone); }); } });