JSFiddle - React, Tailwind, and code Playground
by terebentina
HTML
<div ng-app="app" ng-controller="Ctrl">
<div ng-repeat="elem in data" custom-elem>
</div>
</div>
JavaScript
angular.module('app', []).controller('Ctrl', function($scope, $timeout) {
$scope.data = [];
$timeout(function() {
$scope.data = [
{"type":"h2", "PCDATA":"Title"},
{"type":"p", "PCDATA":"First paragraph."},
{"type":"li", "PCDATA":"list node"},
{"type":"p", "PCDATA":"First paragraph."}
];
}, 1000);
}).directive('customElem', function() {
return {
restrict: 'A',
replace: true,
compile: function(elem, attrs) {
console.log('elem', elem);
}
}
});