是否有可能使一个树形视图角? [英] Is it possible to make a Tree View with Angular?

查看:99
本文介绍了是否有可能使一个树形视图角?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待在一个web应用程序,以显示在一个树状结构的数据。我希望用角这项任务。

I'm looking to display data in a tree structure in a web app. I was hoping to use Angular for this task.

看起来像NG重复会让我通过节点列表迭代,但我怎么能那么就嵌套当一个特定节点的深度的增加?

Looks like ng-repeat will allow me to iterate through a list of nodes, but how can I then do nesting when a given node's depth increases?

我试过以下code ,但是HTML的自动转义为preventing这加工。另外,年底UL标签是在错误的地方。

I tried the following code, but the auto-escaping of the HTML is preventing this from working. Plus, the end ul tag is in the wrong place.

我是pretty肯定,我要去这个问题完全错了。

I'm pretty sure that I'm going about this problem entirely the wrong way.

任何想法?

推荐答案

有一个看看这个小提琴的http://的jsfiddle。净/ brendanowen / uXbn6 / 8 /

Have a look at this fiddle http://jsfiddle.net/brendanowen/uXbn6/8/

这应该给你如何显示树形采用了棱角分明的结构一个好主意。它是一种在HTML中使用递归的!

This should give you a good idea of how to display a tree like structure using angular. It is kind of using recursion in html!

这篇关于是否有可能使一个树形视图角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆