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?

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.