I wanna display specific tree nodes <mat-tree-node> based on a node's nodeAuthorized: boolean property. How can I achieve this since angular does not allow more than 2 structural directives on a single element.
I've tried using the nodeAuthorized property on the only child <div> of <mat-tree-node>, but this renders an empty space between 2 or more tree nodes. Any help would be appreciated?
This is what I've tried but, this leaves an obvious empty space between nodes which I don't want.
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
<div *ngIf="node.treeNode.nodeAuthorized">
<button mat-icon-button matTreeNodeToggle>
<mat-icon class="mat-icon-rtl-mirror">
{{
treeControl.isExpanded(node) ? "expand_more" : "chevron_right"
}}
</mat-icon>
</button>
{{node.treeNode.nodeName}}
</div>
</mat-tree-node>