Recursive custom directives using ngRepeat
I'm trying to create a treeview using AngularJS. Here's my code: module.directive('treeview', function () { return { restrict: 'E', templateUrl: "/templates/ui/controls/treeview.htm", replace: true, transclude: true, scope: {}, link: function (scope, element, attrs) { console.log("treeview directive loaded"); }, controller: function ($scope, $rootScope) { $rootScope.depth = 0; $scope.items = [ { text: "face" }, { text: "palm" }, { text: "cake", childitems: [ { text: "1 face" }, { text: "1 palm" }, { text: "1 cake" } ] } ]; } }; }); module.directive('treeviewItem', function () { return {