Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand menu given id or url #161

Open
jasonmuriel opened this issue Jan 20, 2021 · 2 comments
Open

Expand menu given id or url #161

jasonmuriel opened this issue Jan 20, 2021 · 2 comments

Comments

@jasonmuriel
Copy link

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.

@walvekarnikhil
Copy link

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.

addRandomId(nodes: MultilevelNode[]): void {
nodes.forEach((node: MultilevelNode) => {
node.id = this.generateId();
if (node.items !== undefined) {
this.addRandomId(node.items);
}
});
}

@PhamTienCHung
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants