ng-material-multilevel-menu icon indicating copy to clipboard operation
ng-material-multilevel-menu copied to clipboard

Expand menu given id or url

Open jasonmuriel opened this issue 4 years ago • 2 comments

A call that could open menu/submenus when provided the id or url would be a nice feature. If a user is directed to a certain page then the menu could open to the correct location or if the user refreshes the browser the menu would open up to correct page once again. Unless there is another way to achieve this which I didn't see in demos or documentation.

jasonmuriel avatar Jan 20 '21 02:01 jasonmuriel

MultilevelNode can have id property, can we use that instead of generating new id every time? This way id can be defined and we can use selectMenuByID for browser reload use case.

https://github.com/ShankyTiwari/ng-material-multilevel-menu/blob/1ca630672982f7934f98b3a6ff8b80757e22e0e1/projects/ng-material-multilevel-menu/src/lib/multilevel-menu.service.ts#L20-L27

walvekarnikhil avatar Apr 15 '21 12:04 walvekarnikhil

const node = this.multilevelMenuService.getMatchedObjectByUrl( this.appItems, yourUrl ); this.multilevelMenuService.selectMenuByID(node.id); use this code when your router changes

PhamTienCHung avatar Feb 01 '23 09:02 PhamTienCHung