question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tree is not rendering

See original GitHub issue

Hi there, I don’t know why the tree is just render root, the children are not on version 6.0.1 and up. It works well on v3.2.3. Could you please help to check?

  • This is my code: import { Component, OnInit, OnChanges } from ‘@angular/core’; import { ITreeOptions } from ‘angular-tree-component’;

declare var require: any; @Component({ selector: ‘app-async’, template: <tree-root #tree [options]="options" [nodes]="nodes"></tree-root> , styles: [] }) export class StartPageComponent implements OnInit { ngOnInit() { } options: ITreeOptions = { getChildren: this.getChildren.bind(this) };

  nodes: any[] = [];

  asyncChildren = [
    {
      name: 'child1',
      hasChildren: true
    }, {
      name: 'child2'
    }
  ];

  constructor() {
    this.nodes = [
      {
        name: 'root1',
        children: [
          { name: 'child1' }
        ]
      },
      {
        name: 'root2',
        hasChildren: true
      },
      {
        name: 'root3'
      }
    ];
  }

  getChildren(node: any) {
    const newNodes = this.asyncChildren.map((c) => Object.assign({}, c));

    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(newNodes), 1000);
    });
  }

}

  • It renders as bellow: image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
keathmilligancommented, Mar 12, 2018

Make sure you have imported the stylesheet in your main styles.scss or equivalent:

@import "~angular-tree-component/dist/angular-tree-component.css";

0reactions
Alantom10commented, Jul 22, 2020

I have the same problem and i added the css import also but still continue to have the problem. But for me the import line is @import ‘~@circlon/angular-tree-component/css/angular-tree-component.css’; and not @import ‘~@circlon/angular-tree-component/dist/angular-tree-component.css’; since dist is not an available location in the library. I don’t know if that makes a difference though

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix Trees NOT Rendering/Loading In Fortnite ...
How To Fix Trees NOT Rendering /Loading In Fortnite! (Chapter 3)You may have noticed that Tree's are glitched while using the Performance ...
Read more >
tree does not render nodes · Issue #479 - GitHub
hello, im using the basic example on my Nextjs project only thing i added is NoSsr component to prevent server side rendering (otherwise...
Read more >
Why blender doesn't render my trees
I created this particle plane with trees, but when I render cycles or eevee it doesn't render trees. What I could do? enter...
Read more >
Trees not rendering : r/CODWarzone - Reddit
Trees not rendering. Hello everyone. I'm having an issue with ingame textures. For context im playing on PC, on a 5800x + 6800XT, ......
Read more >
Trees and plants are not rendering in the viewer
Hi,. Since the latest update to Twinmotion, my trees and plants are not displaying properly in the viewer. When I render them they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found