1

I'm trying to implement a very basic usage of Angular Tree Component in my application. Angular version is 9, component version is 9.0.5.

I uncluded TreeModule into my app module's imports. Inserted this in html:

<tree-root [nodes]="nodes"></tree-root>

And this in the TS:

nodes:any[] = [{name:'Test root node', children: []}];

It starts the app and tries to start tree component, but I see these errors: enter image description here

I tried to debug, it looks like the initialization of the component and internal elements is wrong. It tries to access internal VirtualRoot and VirtualScroll before they were created. I also tried to leave nodes collection empty and them add some nodes using:

this.tree.treeModel.update();

Then it doesn't throw exceptions on init, but it doesn't render something, although I see that nodes collection is updated inside TreeModel.

I feel like I'm missing something very basic. We're using redux, I thought it might be conflicting somehow with mobx used in tree component. Any ideas?

Ulad Melekh
  • 924
  • 3
  • 17
  • 33

1 Answers1

0

The problem was in mobx version mismatch. It's listed either as a peer dependency or dependency in angular-tree-component.

Ulad Melekh
  • 924
  • 3
  • 17
  • 33