I Have a directive with transclude text I need to put it inside placeholder
My html
<div ng-controller="Controller">
<my-dialog>Hello world!</my-dialog>
</div>
JS
(function(angular) {
'use strict';
angular.module('docsTransclusionDirective', [])
.controller('Controller', ['$scope', function($scope,$transclude) {
console.log($transclude);
$scope.name = $transclude; // I NEED TO GET HELLO WORLD HERE
}])
.directive('myDialog', function() {
return {
restrict: 'E',
transclude: true,
scope: {},
templateUrl: 'my-dialog.html'
};
});
})(window.angular);\
My template
<div>this should give me transcluded text {{name}}</div>
There are different approaches to get the transcluded content. Have a look at this question