我正在使用 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/