Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.0rc8.js"></script>
<script type="text/ng-template" id="node.html">
{{node.name}}
<ul>
<li ng-repeat="node in node.children" ng-include="'node.html'"></li>
</ul>
</script>
<ul ng-app="Application" ng-controller="TreeController">
<li ng-repeat="node in tree" ng-include="'node.html'"></li>
</ul>
CSS
ul {
list-style: circle;
}
li {
margin-left: 20px;
}
JavaScript
angular.module("myApp", []).controller("TreeController", ['$scope', function($scope) {
$scope.tree = [{
name: "a",
children: [
{
name: "b",
children: []
},
{
name: "c",
children: [
{
name: "d",
children: []
}
]
}]
}];
}]);