Only root nodes are appearing.
See original GitHub issueMy component’s code
constructor( @Optional() private nodes:EvaluationMapperNodes[] ) { } ngOnInit() { this.makeNodes() this.writeAuthorized = this.authenticationService.isUserAuthorized('admin'); } makeNodes(){ this.nodes=[ { id: 1, name: 'root1', children: [ { id: 2, name: 'child1' }, { id: 3, name: 'child2' } ] }, { id: 4, name: 'root2', children: [ { id: 5, name: 'child2.1' }, { id: 6, name: 'child2.2', children:[ {id:7, name:'child2.2.1'} ] } ] }, ]; }
And data type declaration
export class EvaluationMapperNodes { id: number; name: string; children: EvaluationMapperNodes[]; }
Using ‘EvaluationMapperNodes’ class inside EvaluationMapperNodes is giving error that it is not assignable. and If I us any[], only root appears
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top GitHub Comments
For me, the issue was that components were not correctly tagged. So I ended up modifying the .css file by putting ":host /deep/ " in front of all the defined styles - works fine now.
@webwizrd My issue was appearing because I dint include its css in angular-cli.json. Included it and it started working just fine. Its not mentioned in Documentation thats why missed it.