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

The menu items do not link to pages. The demo just writes to the console. Would you provide an example of linking to a page in the app.

Open TiiT opened this issue 7 years ago • 4 comments

Note: for support questions, please use one of these channels: Chat: AngularClass.slack or Twitter: @AngularClass

  • I'm submitting a ... [ ] bug report [ ] feature request [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?

  • What is the current behavior?

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

  • Angular version: 2.0.0-beta.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

TiiT avatar Aug 25 '17 10:08 TiiT

Hi, once you get the clicked item object in the callback method, you can use router.navigate('your_router_url') to navigate to the respective url. This feature facilitates the menu to be used both for url navigation as well as simple item select and perform actions. Hope this helps !! if so, close the issue.

CuppaLabs avatar Aug 28 '17 06:08 CuppaLabs

only use the function that show the article. this functions onItemSelect should be contain the function navigate or navigateByUrl using item.link private onItemSelect(item:any){ console.log(JSON.parse(JSON.stringify(item.link))); this.router.navigateByUrl(JSON.parse(JSON.stringify(item.link))); } now I just need to know how to hide the slide again, because it is showing later that used the link

jonathanoh1 avatar Oct 24 '17 14:10 jonathanoh1

HTML {'title': 'Timetable', 'link': 'client/timetable'},

TS Import the router import {Router} from '@angular/router';

Inject it to your typescript component constructor(private router: Router) { }

Make your onItemSelect method to get the object passed as a parameter and navigate to it using router private onItemSelect(item: any) { console.log(item); this.router.navigateByUrl(item.link); }

cmario92 avatar Jan 28 '18 19:01 cmario92

HTML {'title': 'Timetable', 'link': 'client/timetable'},

can you please let me know above link is root path folder ? example : projectname/src/app/client/timetable ?

sameer05k21a0440 avatar May 07 '18 07:05 sameer05k21a0440