diff --git a/demo-shell/src/app/components/tree-view/tree-view-sample.component.html b/demo-shell/src/app/components/tree-view/tree-view-sample.component.html index 9dfb0850e5..ca75436205 100644 --- a/demo-shell/src/app/components/tree-view/tree-view-sample.component.html +++ b/demo-shell/src/app/components/tree-view/tree-view-sample.component.html @@ -1,10 +1,19 @@
TREE VIEW TEST
- + CLICKED NODE: {{clickedNodeName}} - + + + An Error Occurred + {{errorMessage}} + diff --git a/demo-shell/src/app/components/tree-view/tree-view-sample.component.ts b/demo-shell/src/app/components/tree-view/tree-view-sample.component.ts index fea4caae6e..512de3b858 100644 --- a/demo-shell/src/app/components/tree-view/tree-view-sample.component.ts +++ b/demo-shell/src/app/components/tree-view/tree-view-sample.component.ts @@ -25,10 +25,21 @@ import { Component } from '@angular/core'; export class TreeViewSampleComponent { clickedNodeName: string = ''; + errorMessage = ''; nodeIdSample: string = '-my-'; onClick(node) { this.clickedNodeName = node.entry.name; } + + reset() { + this.clickedNodeName = ''; + this.errorMessage = ''; + } + + onErrorOccurred(error) { + this.clickedNodeName = ''; + this.errorMessage = error; + } } diff --git a/docs/content-services/tree-view.component.md b/docs/content-services/tree-view.component.md index b94509b211..d81c0108c2 100644 --- a/docs/content-services/tree-view.component.md +++ b/docs/content-services/tree-view.component.md @@ -30,4 +30,5 @@ Shows the folder and subfolders of a node as a tree view. | Name | Type | Description | | ---- | ---- | ----------- | +| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when an invalid node id is given. | | nodeClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`>` | Emitted when a node in the tree view is clicked. | diff --git a/lib/content-services/tree-view/components/tree-view.component.html b/lib/content-services/tree-view/components/tree-view.component.html index 92b1504f8b..78aaeafa44 100644 --- a/lib/content-services/tree-view/components/tree-view.component.html +++ b/lib/content-services/tree-view/components/tree-view.component.html @@ -1,9 +1,12 @@ - - + {{treeNode.name}} -