0
我想實現的角度。我jstree使用該插件 https://github.com/ezraroi/ngJsTree 我收到此錯誤爲什麼控制器不能在angiular js中工作?
b.tree.jstree不是一個函數
我遵循的所有步驟,並作出codepen但我的樹不顯示。
這裏是我的代碼 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);
})
任何更新?