angularjs - angular jstree does not showing -
i trying show ngjstree in loaded ng-veiw tree not showed here html definition :
<div js-tree="treeconfig" ng-model="treedata" should-apply="vm.applymodelchanges()"></div>
and here controller inject angular :
app.registerctrl('orgchartctrl', ['$scope', '$http', function ($scope, $http) { $scope.treeconfig = { core: { multiple: false, error: function (error) { alert('treectrl: error js tree - ' + angular.tojson(error)); }, }, version: 1 } $scope.$on('$viewcontentloaded', function () { alert(""); $scope.treedata = [ { id: 'ajson1', parent: '#', text: 'simple root node' }, { id: 'ajson2', parent: '#', text: 'root node 2' }, { id: 'ajson3', parent: 'ajson2', text: 'child 1' }, { id: 'ajson4', parent: 'ajson2', text: 'child 2' } ]; $scope.treeconfig.version++; }); this.applymodelchanges = function () { return true; };
i try without viewcontextloaded , didnt work out too.
any idea ?
i had forgot add 'ngjstree' angular app module collection. see :
var app = angular.module('app', [ 'nggrid', 'ngjstree', 'ngroute'// ]);
Comments
Post a Comment