Open lesianocmn opened 3 years ago
How are you adding the nodes? I tried it with the normal getChildren function and also with just resetting the nodes after the page loaded. Both work for me without clicking.
Hello, Thanks for your comment. I'm also resetting the nodes and I'm using the getChildren function. I kind find out a solution using ChangeDetectionStrategy OnPush.
I had the same problem. The tree showed after click only.
I tried several workarounds. This works for me:
constructor(private ref: ChangeDetectorRef){}
ngOnInit() {
this.myService.getNodes().subscribe(nodes => {
this.nodes = [...nodes];
this.ref.detectChanges();
});
}
It worked before I migrated to angular v 12 and material. No idea if there's a connection
Hi @colorcube ,
Yes, It's what I did.. I think it's the only solution by now..
Hello,
I have an issue with showing the tree.
Before after adding nodes you could see the information. Now I have to click on the screen to see the tree with the nodes. (if not it continues showing "loading")
I checked and If I add a setTimeout with anything there after change the tree, it is showing again.
I'm missing something or do I have to change something?
Thanks for your help.