JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app="app" ng-controller="test">
   <ul>
       <li nested-item ng-repeat="item in items">{{item.title}}</li>
   </ul>         
</div>

JavaScript

var items = [{
	title: 'Something',
	children: [
		{ title: 'Hello World' },
		{ title: 'Hello Overflow' },
		{ title: 'John Doe', children: [
			{ title: 'Amazing title' },
			{ title: 'Google it' },
			{ title: 'Im a child', children: [
				{ title: 'Another ' },
				{ title: 'He\'s my brother' },
				{ title: 'She\'s my mother.', children: [
					{title: 'You never know if im going to have children'}
				]}
			]}
		]}
	]
}];

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

app.controller('test', function( $scope ) {
    $scope.items = items;
});


app.directive('nestedItem', ['$compile', function($compile){
    return {
        restrict: 'A',
        link: function(scope, element){
        console.log(element);
            if (scope.item.children){
                var html = $compile('<ul><li nested-item ng-repeat="item in item.children">{{item.title}}</li></ul>')(scope);
                element.append(html);
            }
        }
    };
}]);