简体   繁体   English

Angular+PrimeNG+Sakai骨架项目:重新路由sakai演示

[英]Angular+PrimeNG+Sakai skeleton project: rerouting sakai demo

I have cloned the Sakai angular skeleton from here: git clone https://github.com/primefaces/sakai-ng.git我从这里克隆了 Sakai angular 骨架: git clone https://github.com/primefaces/sakai-ng.git

By default, the 'landing' URL points to the Sakai demo.默认情况下,'landing' URL 指向 Sakai 演示。 I want my base URL to point to my application, while keeping Sakai's demo as a reference (at least during the dev phase).我希望我的基础 URL 指向我的应用程序,同时保留 Sakai 的演示作为参考(至少在开发阶段)。 For that, I want to reroute the whole sakai demo to a 'sakai' route, in such a way that:为此,我想将整个 sakai 演示重新路由到“sakai”路由,这样:

  • " myUrl/#/sakai " takes me to the Sakai Dashboard, myUrl/#/sakai ” 将我带到 Sakai 仪表板,
  • " MyUrl/#/sakai/uikit/formlayout " takes me to the specific 'UIKit/Form Layout' demo, MyUrl/#/sakai/uikit/formlayout ” 将我带到特定的“UIKit/Form Layout”演示,
  • etc for every Sakai demo page...每个 Sakai 演示页面等...

So in my app-routing.module.ts, I have done:所以在我的 app-routing.module.ts 中,我做了:

RouterModule.forRoot([
    // My Application
    //{ path: '', component: HomeComponent },

    // Sakai
    {
        path: 'sakai', component: AppLayoutComponent,
        children: [
            { path: '', loadChildren: () => import('./sakai/components/dashboard/dashboard.module').then(m => m.DashboardModule) },
            { path: 'uikit', loadChildren: () => import('./sakai/components/uikit/uikit.module').then(m => m.UikitModule) },
            { path: 'utilities', loadChildren: () => import('./sakai/components/utilities/utilities.module').then(m => m.UtilitiesModule) },
            { path: 'documentation', loadChildren: () => import('./sakai/components/documentation/documentation.module').then(m => m.DocumentationModule) },
            { path: 'blocks', loadChildren: () => import('./sakai/components/primeblocks/primeblocks.module').then(m => m.PrimeBlocksModule) },
            { path: 'pages', loadChildren: () => import('./sakai/components/pages/pages.module').then(m => m.PagesModule) },
        ],
    },
    // code continues...

But doing so doesn't work properly with the demo's left-side menu as it keeps using the old route for the links: MyUrl/#/uikit/formlayout instead of: MyUrl/#/sakai/uikit/formlayout但是这样做不能与演示的左侧菜单一起正常工作,因为它一直使用链接的旧路径: MyUrl/#/uikit/formlayout而不是: MyUrl/#/sakai/uikit/formlayout

I tried to fiddle inside the Sakai components' own routing modules without success.我试图在 Sakai 组件自己的路由模块中摆弄,但没有成功。

Can anyone tell me how I can achieve this?谁能告诉我如何实现这一目标?

You have to adjust the dashboard routerLinks in您必须调整仪表板 routerLinks

src/app/layout/app.menu.component.ts

I have the same problem.我也有同样的问题。 Did you figure out a solution?你找到解决办法了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM