Hi
I'm having trouble rounding for a named router outlet like:
ie routing from
More specifically:
<rz-panelmenu-item image="./assets/images/ic_archive_white_48dp.png" text="Statistikker" [style]="{'background-color':'#6c8993'}">
<rz-panelmenu-item image="./assets/images/ic_view_module_white_48dp.png" path="forespoergelse/Bestand/(Forespoegsel:powerbi)" text="Medlemsbestand" [style]="{'background-color':'#6c8993'}">
<rz-panelmenu-item image="./assets/images/ic_view_module_white_48dp.png" path="forespoergelse/Medlemsbevægelser/(Forespoegsel:powerbi)" text="Medlemsbevægelser" [style]="{'background-color':'#6c8993'}">
via:
export const routes: Routes = [
{path: '', redirectTo: '/forside-cards', pathMatch: 'full'},
{
path: '',
component: MainLayoutComponent,
children: [
{
path: 'send-rapport',
component: SendRapportComponent
},
{
path: 'forside-cards',
component: ForsideCardsComponent
},
{
path: 'forespoergelse/:model',
component: ForespoergelseComponent,
children: [
{
path: 'powerbi', component: PowerbiReportComponent,
outlet: 'Forespoegsel'
},
It is path="forespoergelse/Bestand/(Forespoegsel:powerbi)" that appears in the browser url as:
http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)
and then the roiding doesn't work. It should read as follows:
http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)
otherwise it will not work.
What should I do so that the path="forespoergelse/Bestand/(Forespoegsel:powerbi)" menu appears correctly in the browser?
Yours sincerely
Carsten Gissel
I am sorry but I couldn't understand what the problem is.
It is path="forespoergelse/Bestand/(Forespoegsel:powerbi)" that appears in the browser url as:
http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)
and then the roiding doesn't work. It should read as follows:
http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)
Those urls look the same to me.
Sorry Korchev i mean
path="forespoergelse/Bestand/(Forespoegsel:powerbi)" that appears in the browser url as:
localhost:4200/forespoergelse/Bestand/%28Forespoegsel:powerbi%29
and then the rauiding doesn't work. It should read as follows:
http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)
otherwise it will not work.
What should I do so that the path="forespoergelse/Bestand/(Forespoegsel:powerbi)" menu appears correctly in the browser?
Yours sincerely
Carsten Gissel
Oh I see. It seems that the RouterLink directive that the PanelMenu uses under the hood encodes the (
and )
. The only suggestion I can give is to use full url:
path="http://localhost:4200/forespoergelse/Bestand/(Forespoegsel:powerbi)"
or
path="/forespoergelse/Bestand/(Forespoegsel:powerbi)"
Then the PanelMenu will use a regular <a href="">
which doesn't do any URL encoding.
Thank you,
I have had this problem before, where I have put the / in the front, forgot about it.
Yours sincerely
Carsten Gissel
Hello again
So the problem now is that the menu collapses every time you select a sub-menu item, how can I avoid it?
Yours sincerely
Carsten Gissel
You can't. The menu will auto expand only if the current page matches the item url.