copy and paste options from here
https://angular2-tree.readme.io/docs/options-2
and make changes to this properties
displayField: 'name',
isExpandedField: 'expanded',
idField: 'id',
hasChildrenField: 'children'
make changes in tsconfig.json file
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"strictTemplates": true
}
start the project with ng serve -o
You will receive this error:
error TS2740: Type '{ displayField: string; isExpandedField: string; idField: string; hasChildrenField: string; actionMapping: { mouse: { dblClick: (tree: any, node: any, $event: any) => void; }; keys: { [x: number]: (tree: any, node: any, $event: any) => void; }; }; ... 9 more ...; scrollContainer: HTMLElement; }' is missing the following properties from type 'TreeOptions': options, childrenField, getChildren, useVirtualScroll, and 7 more.
<tree-root [nodes]="nodes" [options]="options">
Now exit the project with ctrl + c and make changes to tsconfig.json
"angularCompilerOptions": {
"fullTemplateTypeCheck": false,
"strictInjectionParameters": false,
"strictTemplates": false
}
PLEASE READ CAREFULLY!
Reproduce
You will receive this error:
<tree-root [nodes]="nodes" [options]="options">
Now exit the project with ctrl + c and make changes to tsconfig.json "angularCompilerOptions": { "fullTemplateTypeCheck": false, "strictInjectionParameters": false, "strictTemplates": false }
The error is gone.