Hey,
The Term Transclusion means unhidding the context that is already present in the element level along with the template content.
Let us first consider achieving transclusion using link function:
The generic code is:
app.directive(' Message', function(){
return{
templateUrl: info.html,
transclude:true,
link: function(scope, iElement, iAttrs, controller, transclude){
var content=transclude();
iElement.find(#innerpannel).append(content)
}
} }
Now, consider the second case that is to achieve transclusion using diricitive controller:
The generic code is:
app.directive(' Message', function(){
return{
templateUrl: info.html,
transclude:true,
Controller: function($scope, $element, $Attrs, $transclude){
var content=$transclude();
$element.find(#innerpannel).append(content)
}
} }
Hope this will help you to generate transclusion!!