angular-tree-control icon indicating copy to clipboard operation
angular-tree-control copied to clipboard

A bug on line 68

Open lizhongit opened this issue 9 years ago • 3 comments

Original code:

     function defaultIsLeaf(node) {
            return !node[$scope.options.nodeChildren] || node[$scope.options.nodeChildren].length === 0;
      }

Sometimes, My Dir will be empty, So except like this:

     function defaultIsLeaf(node) {
          return !node[$scope.options.nodeChildren];
      }

lizhongit avatar Jun 17 '16 03:06 lizhongit

I am not sure I understand - why is the code above wrong?

yoavaa avatar Jun 19 '16 19:06 yoavaa

@yoavaa If my DIR empty but icon are leaf, May be the DIR no any children leaf, but it is real DIR, I can open it

lizhongit avatar Dec 28 '16 23:12 lizhongit

The new code:

    function defaultIsLeaf(node, $scope) {
        // return !node[$scope.options.nodeChildren] || node[$scope.options.nodeChildren].length === 0;
        return !Array.isArray(node[$scope.options.nodeChildren]);
    }

lizhongit avatar Dec 29 '16 00:12 lizhongit