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

not able to close loading on click of node arrow(getChildren) in case of an error from server or not data response from server

Open subbu95 opened this issue 6 years ago • 1 comments

the get children function

getChildren(node:TreeNode) { return new Promise((resolve, reject) => { this.yourService.getChildren(node.data).subscribe(data => { resolve(data ); }, error => this.onLoadFailed(error)); }); }

Please explain what to do in this.onLoadFailed(error) function

subbu95 avatar Jul 15 '19 11:07 subbu95

What we in our project currently do is adding an error node to the tree. This way our getChildren always returns something. The user can than click that node again and it will reload the failed request. At first this felt a bit like a weird workaround, but it's working quite nice from an ux perspective in our project. But we will need to fix this and introduce better error handling in the angular-tree-component.

tobiasengelhardt avatar Jul 09 '20 09:07 tobiasengelhardt