JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js"></script>
<div ng-app="app">
<div>Inner: <inner>✔︎</inner></div>
<div>Outer: <outer>✔</outer></div>
<div>Workaround: <workaround>✔</workaround></div>
</div>
JavaScript
var app = angular.module('app', []);
app.directive('inner', function() {
return {
restrict: 'E',
transclude: true,
template: '<u ng-transclude></u>'
};
});
app.directive('outer', function() {
return {
restrict: 'E',
transclude: true,
template: '<a href="#"><inner ng-transclude></inner></a>'
};
});
app.directive('workaround', function() {
return {
restrict: 'E',
transclude: true,
template: '<a href="#"><inner><foo ng-transclude></foo></inner></a>'
};
});