Transclusion AngularJS

by shushanth pallegar

HTML

<div ng-app="myApp">
    
    <div class=" basicE">
        <p>I am from static HTML (transclude helps me to display :))</p>
        
    </div>
    
</div>

JavaScript

var App = angular.module('myApp',[]);

//directive
App.directive('basicE',basicElement);


function basicElement(){

    return{
    
        restrict:'EAC',
        transclude:true,
        template:'<h2>Hello i am from directive</h2><p ng-transclude></p>'
    
    }


}