export class NodeTemplate {
    clickedNode = null;
    nodeInterface = {
        nodeClicked: (node) => {
            console.log("I'm here", node);
            this.clickedNode = node;
        }
    };

    attached() {
        this.tree.dataSource.load(this.getNodes());
    }

    getNodes() {
        return [
            {
                title: 'Texas',
                children: [
                    { title: 'Austin' },
                    { title: 'Houston' }
                ]
            }, {
                title: 'New York',
                children: [
                    {
                        title: 'New York City',
                        children: [
                            { title: 'Manhattan' },
                            { title: 'Brooklyn' },
                            { title: 'Bronx' },
                            { title: 'Queens' },
                            { title: 'Staten Island' }
                        ]
                    }, {
                        title: 'Buffalo'
                    }
                ]
            }, {
                title: 'Oregon',
                children: [
                    { title: 'Portland' }
                ]
            }, {
                title: 'California',
                children: [
                    { title: 'Los Angeles' },
                    { title: 'San Francisco' }
                ]
            }
        ];
    }
}

export class NodeTemplate {
  clickedNode = null;
  nodeInterface = {
    nodeClicked: (node) => {
      console.log("I'm here", node);
      this.clickedNode = node;
    }
  };

  attached() {
    this.tree.dataSource.load(this.getNodes());
  }

  getNodes() {
    return [
      {
        title: 'Texas',
        children: [
          { title: 'Austin' },
          { title: 'Houston' }
        ]
      }, {
        title: 'New York',
        children: [
          {
            title: 'New York City',
            children: [
              { title: 'Manhattan' },
              { title: 'Brooklyn' },
              { title: 'Bronx' },
              { title: 'Queens' },
              { title: 'Staten Island' }
            ]
          }, {
            title: 'Buffalo'
          }
        ]
      }, {
        title: 'Oregon',
        children: [
          { title: 'Portland' }
        ]
      }, {
        title: 'California',
        children: [
          { title: 'Los Angeles' },
          { title: 'San Francisco' }
        ]
      }
    ];
  }
}

format code