AlexSuleap / angular-tree-widget

Angularjs tree control, which does not require jquery.
http://AlexSuleap.github.io
MIT License
34 stars 13 forks source link

Initial expand #12

Open ghost opened 7 years ago

ghost commented 7 years ago

Thank you for creating a simple and clear example that works! I wanted the tree initially collapsed and defined expanded:false in $scope.options in the controller as follows:

$scope.options = {
            expanded: false,
            expandOnClick: true,  ...

but it didn't seem to have any effect, the tree was fully expanded initially. I made a small change in \demo\dist\angular-tree-widget.js and it worked, but I thought you might want to check it out.

//expanded all the nodes
    if (node.expanded === undefined && node.children != undefined) {
    // node.expanded = true;
    // dk changed to false
    node.expanded = false;
    }

Once again, thank you for a brilliant piece of work!