import { Component, OnInit } from '@angular/core'; @Component({ selector: 'mat-transfer', templateUrl: './mat-transfer.component.html', styleUrls: ['./mat-transfer.component.less'] }) export class MatTransferComponent implements OnInit { tree = { value: 'grandfather', id: 1, children: [ { id: 2, value: 'child1' }, { id: 3, value: 'child2', children: [ { id: 4, value: 'grandchild' } ] } ] }; onNodeExpanded() { console.log(this.tree); } onNodeCollapsed() { console.log(this.tree); } ngOnInit(): void { throw new Error('Method not implemented.'); } }