I have a simple controller:
.controller(\"TestController\",[\'$scope\', function($scope) {
this.p = {};
this.p.name = \"Foo\";
this.p.surname = \"Bar
I forked your Plunker to add Transclusion. The Directive Transcludes the element, replacing it entirely. It then takes the cloned (original contents) and inserts them into the Transclusion, making the original elements become compiled as part of the directive.
app.directive('cronosDataset',[function() {
return {
restrict: 'A',
controller:'TestController',
controllerAs: "ctrl",
scope: {
cronosDataset : "@"
},
transclude: 'element',
replace: true,
link: function(scope, elem, attrs, ctrl, transclude) {
transclude(scope, function(clone) {
elem.after(clone);
});
}
};
}])