Description
Hi,
I have a mat-tree associated with the tree control:
public readonly mainMenuTreeControl = new NestedTreeControl<IMainMenuNode, string>(node => node.children, { trackBy: this.mainMenuItemTrackBy });
where this.mainMenuItemTrackBy
is defined as (menuNode: IMainMenuNode): string{ ... }
when used in a view like <mat-tree [dataSource]="..." [treeControl]="mainMenuTreeControl">...</mat-tree>
compiler reports an error:
error TS2322: Type 'NestedTreeControl<IMainMenuNode, string>' is not assignable to type 'TreeControl<IMainMenuNode, IMainMenuNode>'.
31 [treeControl]="mainMenuTreeControl"
from what I have seen in code I believe MatTree should in fact be MatTree<T, K =T> as is NestedTreeControl defined and the property treeControl should also be: @Input() treeControl: TreeControl<T, K>;
Can you help me?
Thanks in advance
POFerro