cuppa-ng2-slidemenu icon indicating copy to clipboard operation
cuppa-ng2-slidemenu copied to clipboard

side menu auto close

Open suriyaJaay opened this issue 6 years ago • 3 comments

How to pls tell me how to auto close the side menu when clicking on particular menu.?

by doing this, how to load corresponding page while clicking menu routing.

pls share you ideas

suriyaJaay avatar Apr 13 '18 13:04 suriyaJaay

change app.component.ts

find:

private onItemSelect(item: any) { console.log(item); }

and just call onMenuClose()

so will be something like

private onItemSelect(item: any) { onMenuClose(); }

rf2001dev avatar Apr 13 '18 14:04 rf2001dev

You may use config attribute. In your html-template add:

<cuppa-slidemenu [menulist]="menuItems"
                 (onItemSelect)="onItemSelect($event)"
                 [config]="menuConfig">
  </cuppa-slidemenu>

In your component.ts add:

 private menuConfig: any = {
    animation: "collapse",
    offset: {  top: 55   },
    closeOnCLick: true
  };

Hope I helped you.

AndzejChwalko avatar Apr 28 '18 16:04 AndzejChwalko

menuclose is not happening even , if i use the above code.Menu items are showing

sbabu955 avatar Oct 08 '18 10:10 sbabu955