【发布时间】:2016-01-04 08:21:58
【问题描述】:
我正在尝试以 Angular 实现 jstree。我使用了这个插件 https://github.com/ezraroi/ngJsTree 我收到此错误
b.tree.jstree 不是函数
我按照所有步骤制作了一个代码笔,但我的树没有显示。
这是我的代码 http://codepen.io/naveennsit/pen/qbRyVP?editors=101
angular.module('app',['ngJsTree']).controller('myCtrl',function($scope,$log){
$scope.treeConfig = {
core : {
multiple : false,
animation: true,
error : function(error) {
$log.error('treeCtrl: error from js tree - ' + angular.toJson(error));
},
check_callback : true,
worker : true
},
types : {
default : {
icon : 'glyphicon glyphicon-flash'
},
star : {
icon : 'glyphicon glyphicon-star'
},
cloud : {
icon : 'glyphicon glyphicon-cloud'
}
},
version : 1,
plugins : ['types','checkbox']
};
$scope.originalData = [
{ id : 'ajson1', parent : '#', text : 'Simple root node', state: { opened: true} },
{ id : 'ajson2', parent : '#', text : 'Root node 2', state: { opened: true} },
{ id : 'ajson3', parent : 'ajson2', text : 'Child 1', state: { opened: true} },
{ id : 'ajson4', parent : 'ajson2', text : 'Child 2' , state: { opened: true}}
];
$scope.treeData = [];
angular.copy($scope.originalData,$scope.treeData);
})
有什么更新吗?
【问题讨论】:
标签: angularjs angularjs-directive angularjs-scope angular-ui-router jstree