css - Angular 树中没有分支

标签 css angularjs treeview

我正在使用 Angular 树。它工作正常但是当分支不起作用时节点的间距......即它们都以直线进入而不是彼此相距一定距离。我也在浏览器控制台上收到此错误。

Error: Lexer Error: Unexpected next character  at columns 36-36 [?] in expression ['level-' + 1 + (row.branch.selected ? ' active':'')].
at Error (<anonymous>)
at throwError (http://localhost:8080/AngularJS/js/scripts/angular.js:6309:11)
at lex (http://localhost:8080/AngularJS/js/scripts/angular.js:6272:9)
at parser (http://localhost:8080/AngularJS/js/scripts/angular.js:6466:16)
at http://localhost:8080/AngularJS/js/scripts/angular.js:7080:29
at compileToFn (http://localhost:8080/AngularJS/js/scripts/angular.js:8973:16)
at Object.Scope.$watch (http://localhost:8080/AngularJS/js/scripts/angular.js:8305:19)
at http://localhost:8080/AngularJS/js/scripts/angular.js:13541:11
at nodeLinkFn (http://localhost:8080/AngularJS/js/scripts/angular.js:4774:13)
at compositeLinkFn (http://localhost:8080/AngularJS/js/scripts/angular.js:4365:15) <li ng-repeat="row in tree_rows | filter:{visible:true} track by row.branch.uid" ng-animate="'abn-tree-animate'" ng-class="'level-' + {{ row.level }} + (row.branch.selected ? ' active':'')" class="abn-tree-row ng-scope abn-tree-animate-enter-setup"> 

这是我的html文件

<ul class="nav nav-list abn-tree">
 <li ng-show="header" class="nav-header">{{ header }}</li>
 <li ng-repeat="row in tree_rows | filter:{visible:true} track by row.branch.uid" ng- animate="'abn-tree-animate'" ng-class="'level-' + {{ row.level }} + (row.branch.selected ?  ' active':'')" class="abn-tree-row"><a id="{{ row.label }}" ng-  click="user_clicks_branch(row.branch)"><i ng-class="row.tree_icon" ng-click="row.branch.expanded = !row.branch.expanded" class="indented tree-icon"> </i><span   class="indented tree-label">{{ row.label }}</span></a></li>
</ul>

最佳答案

你似乎想用我的 angular-bootstrap-nav-tree .

该元素最近已更新,可以在 Bootstrap 2 或 Bootstrap 3 下正常工作,也可以与 Angular 1.1.5 或 Angular 1.2.0(现在是 MIT 许可证)一起工作

现在有 4 个工作示例页面,使用这些不同版本的 Bootstrap 和 Angular。请再看一眼 -- 我相信您一定能够成功。

关于css - Angular 树中没有分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18845619/

相关文章:

c# - 向 TreeView 添加图形

javascript - 使用 CSS 切换内容

css - 如何在具有属性的部分中设置类 (css) 的样式

javascript - 如何限制使用 Angular.js/JavaScript 选中的复选框

javascript - 循环填充表格

c# - 使用 SQL 数据库及其表填充 Treeview

c# - 在虚拟化 WPF TreeView 中滚动非常不稳定

jquery - SVG map onclick 背景颜色应为黑色 "#000"

html - IE9 无法解析超过 ~ 4100 个类的 CSS 文件

json - 使用 Spring MVC RESTful Web 服务的 Angularjs