'ANGULAR ng-material-multilevel-menu, select next label with button in component

enter image description hereI downloaded ng material multilevel menu library. I want to create functionality that you can select next label (based on current selected label) on press of a button. Problem is that if label is closed, child items are not even in the DOM.

 <ng-material-multilevel-menu [items]='appitems' [configuration]='config' (selectedItem)="selectedItem($event)">
    <ng-template #listTemplate let-item="item" let-configuration="configuration">
        <div class="my-cool-menu-item" [dir]="configuration.rtlLayout  ? 'rtl' : 'ltr'">
            <div class="title-and-image">
                <div class="icon-container">
                    <span [ngClass]="getClass(item)"></span>
                </div>
                <div class="label-container">
                    <span>{{item.label}}</span>
                </div>
            </div>
            <div class="icon-arrow-container" *ngIf='item.hasChilden'>
                <mat-icon *ngIf="!configuration.rtlLayout" [@ExpandedLTR]="item.expanded ? 'yes' : 'no'">
                    keyboard_arrow_down
                </mat-icon>
                <mat-icon *ngIf="configuration.rtlLayout" [@ExpandedRTL]="item.expanded ? 'yes' : 'no'">
                    keyboard_arrow_down
                </mat-icon>
            </div>
        </div>
    </ng-template>
</ng-material-multilevel-menu>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source