As you can see, once we've grabbed
$transclude, the rest of the manipulations are actually quite standard. In this case, because we've distributed the transcluded content in a piecemeal manner, we end up not even ever inserting the
clone element itself back into the DOM; however there might be other times when you only want to extract part of the element for use elsewhere, and then insert the rest back into its normal location. In either case, always remember that transclusion is your friend when you need to interact with the content internal to your directive. Use the standard
ng-transclude directive when you want the content unaltered, and
$transclude if you need to manipulate it first. Coming up next we're going to spend ...