How to handle recursive rendering of data using AngularJS

前端 未结 3 1449
南笙
南笙 2020-12-16 06:52

I have an application that has set of data that has a recursive relationship (a tree view, using recursion.) I\'ve tried several ways to implement this via Angular, none of

3条回答
  •  遥遥无期
    2020-12-16 07:39

    If you are familiarized with batarang tool, it has a treeview of scopes. You can see the source here:

    https://github.com/angular/angularjs-batarang/blob/master/js/directives/scopeTree.js

    The idea is simple. Using $compile to recursively render that directive for every children it finds until there is no more children to render.

    I saw that same idea for other alternatives, take a look here:

    Is it possible to make a Tree View with Angular?

提交回复
热议问题