primeng icon indicating copy to clipboard operation
primeng copied to clipboard

[BUG] RouterLink not working in p-panelMenu

Open igogu opened this issue 9 years ago • 21 comments

[ X] bug report => Search github for a similar issue or PR before submitting

Plunkr Case (Bug Reports) It's not a working plunkr, but you can see the code https://plnkr.co/edit/d6BSgRYbBzk7r4NB4bwy?p=info

Current behavior When you set a routerlink to a child menuItem, this is not redirecting to any component. However, when a parent menuItem has a RouterLink, this can redirect to a component

Expected behavior when a child of menuItem has RouterLink, it should redirect to a component.

Minimal reproduction of the problem with instructions


 this.itemsPrueba = [                      
                      {
                          label: 'Articles',
                          icon: 'fa-edit',
                          items: [
                              {label: 'Articles Gamma', icon: 'fa fa-dot-circle-o fa-fw', routerLink: ['/index/articles']},
                          ]
                      },
                      
                  ];
<p-panelMenu [model]="itemsPrueba" ></p-panelMenu>

For more details, go to the plunkr

What is the motivation / use case for changing the behavior? In Angular 2.x.x and primeNG 2.0.5 was working right,

Please tell us about your environment: OS: Ubuntu 16.04 IDE: Eclipse Neon package manager: npm 3.10.9 typescript 2.2.2

  • Angular version: 2.0.X Angular version: 4.0.0 & 4.0.1 (its not working with no one of those)

  • PrimeNG version: 2.0.X PrimeNG version:** 4.0.0-rc.2

  • Browser: [all ]

  • Language: [all]

igogu avatar Mar 30 '17 09:03 igogu

I experience probably the same issue with using angular 4.0.0 and V4 rc2. the routerLink redirection was working with angular 4.0.0 and V4 rc1.

snowping avatar Mar 30 '17 11:03 snowping

The same issue here, using angular 4.0.0-rc2 the routerLink redirection does not working

erlopezh avatar Mar 30 '17 16:03 erlopezh

Same here using angular 4.0.1 and primeng 4.0.0-rc.2. The link is incorrect. It has href="#".

This change is the issue: issue

derchirurg avatar Apr 03 '17 07:04 derchirurg

The same issue with MenuBar used to work fine and stopped working after updating, links shows "/#" no errors in console.

xyz765 avatar Apr 03 '17 10:04 xyz765

@xyz765 Same for me.

Brampage avatar Apr 03 '17 10:04 Brampage

I got the same Issue but only on the SubMenuItems. The routerLink on a top Level MenuItem works just fine.

ImproSnake avatar Apr 03 '17 11:04 ImproSnake

got the same bug. Is there any workaround for now?

SchneMa avatar Apr 03 '17 13:04 SchneMa

Use rc.1

kcsahoo avatar Apr 03 '17 15:04 kcsahoo

@kcsahoo i'm sorry, can you explain? this is my first pull request ever.

mamarillo avatar Apr 03 '17 16:04 mamarillo

In your application you have to use Primeng V4.0.0-rc.1 with Angulat V4.0.1 I have tested. All features work.

kcsahoo avatar Apr 04 '17 10:04 kcsahoo

I hope Primeng team will resolve this issue in next rc version and rtm version

kcsahoo avatar Apr 04 '17 10:04 kcsahoo

Also have this bug. routerlink just seems to not be getting set at all

SIlver-- avatar Apr 07 '17 22:04 SIlver--

I have the same problem

Czin7 avatar Apr 14 '17 11:04 Czin7

same bug. routerLink is not correctly set. Primeng v4.0.0-rc.1 works with Angular 4.0.2.

elega9t avatar Apr 18 '17 07:04 elega9t

And here with PrimeNG v4.0.0-rc3 and Angular 4.0.3

My code is;

{ label: 'Filesystem', routerLink: ['/filesystemrepository'] }, { label: 'AWS', url: 'http://www.primefaces.org/primeng' },

The AWS menu item works fine. the Filesystem one is rendered with href="#"

No errors in console either.

paulkeogh avatar Apr 23 '17 16:04 paulkeogh

Can you try with 4.0 final?

cagataycivici avatar May 02 '17 15:05 cagataycivici

Duplicate of https://github.com/primefaces/primeng/issues/2522

cagataycivici avatar May 02 '17 15:05 cagataycivici

Still happening for me in 4.0.0 final using angular 4.1

https://plnkr.co/edit/KlPzhzvFzXfTqL82SIzy?p=preview

Notice that the href is rendered as href="#"

(primeng seems to be down atm for plunker)

a496736 avatar May 02 '17 16:05 a496736

I can't replicate the issue.It works good in latest version. Please try on latest version. Currently the issue exists for TieredMenu only.

sudheerj avatar May 14 '17 15:05 sudheerj

Is there a filed issue for TieredMenu?

cagataycivici avatar May 15 '17 06:05 cagataycivici