How to delete a node in Angular Tree

847 Views Asked by At

I need to delete a node in Hierarchy Tree built using the link http://jsfiddle.net/brendanowen/uXbn6/8/

The delete option explained deletes only the child node.

 $scope.delete = function(data) {
        data.nodes = [];
    };

But i need to delete the parent node(data) itself. I have tried $scope.data.splice($index,1) which deletes the object only at straight first level. Splicing and filtering doesn't help in deleting hierarchy level nodes (e.g. node at level 3) in hierarchy. I have a hierarchy level of 8. How to proceed on this logic?Please help.

0

There are 0 best solutions below