From: Bill Erickson Date: Fri, 16 Aug 2019 20:50:34 +0000 (-0400) Subject: LP1840050 Anguar tree component realtime updates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=529d556773255b1b2d86241a9d1d4d528d059d37;p=evergreen%2Fpines.git LP1840050 Anguar tree component realtime updates Teach the Angular tree component to re-render itself when its underyling tree has been replaced. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/share/tree/tree.component.ts b/Open-ILS/src/eg2/src/app/share/tree/tree.component.ts index f519268f46..64dd298215 100644 --- a/Open-ILS/src/eg2/src/app/share/tree/tree.component.ts +++ b/Open-ILS/src/eg2/src/app/share/tree/tree.component.ts @@ -37,7 +37,18 @@ nodeClicked(node: TreeNode) { }) export class TreeComponent implements OnInit { - @Input() tree: Tree; + _tree: Tree; + @Input() set tree(t: Tree) { + if (t) { + this._tree = t; + this._tree.nodeList(); // reindex nodes + } + } + + get tree(): Tree { + return this._tree; + } + @Output() nodeClicked: EventEmitter; constructor() {