I'm trying to build a few in AngularJS that recursively includes itself. Each WorkflowProcess
has children WorkflowProcess
and I'd like the tree to be infinitely included.
Currently it looks like:
It should be displaying...
Approval
|
---------
|
Impositioning
Here's my template:
<div>
<select ng-model="workflow" ng-options="workflow.name for workflow in workflows"></select>
</div>
<div class="tree">
<ul>
<div ng-repeat="workflowProcess in workflow.workflowProcesses" ng-include="'/partials/admin/workflow-tree-node.htm'"></div>
</ul>
</div>
workflow-tree-note.html
<li ng-repeat="childWorkflowProcess in workflowProcess.workflowProcesses">
<a>{{childWorkflowProcess.entity.name}}</a>
<ul>
<ng-include src="'/partials/admin/workflow-tree-node.htm'" />
</ul>
</li>
It's displaying "Impositioning" over and over. I'm recognizing that that's because the loop in the html is referencing the same data. I'm not sure how to make it just reference the next tier of data.
Every workflow has a property workflowProcesses
.