OJET v18, MVMM architecture with Typescript
I am using the generated navbar template project and extending it.
So in the appController.ts I have
const routes = [
{ path: "", redirect: "sites" },
{ path: "sites", detail: { label: "Sites", iconClass: "oj-ux-ico-sites" } },
{ path: "statistics", detail: { label: "Statistics", iconClass: "oj-ux-ico-dimensional-bar-graph" } },
{ path: "administration", detail: { label: "Administration", iconClass: "oj-ux-ico-administration" } },
{ path: "sites/{siteName}", detail: { label: "Administration", iconClass: "oj-ux-ico-administration" }, module: "sitedetails"},
];
const navData = [
{ path: "sites", detail: { label: "Sites", iconClass: "oj-ux-ico-sites" } },
{ path: "statistics", detail: { label: "Statistics", iconClass: "oj-ux-ico-dimensional-bar-graph" } },
{ path: "administration", detail: { label: "Administration", value: "sitedetails", iconClass: "oj-ux-ico-administration" } },
];
// router setup
const router = new CoreRouter(routes, {
urlAdapter: new UrlPathParamAdapter("/")
});
router.sync();
this.moduleAdapter = new ModuleRouterAdapter(router);
this.selection = new KnockoutRouterAdapter(router);
this.navDataProvider = new ArrayDataProvider(navData, {keyAttributes: "path"});
And in the index.html
<other-general-html>
<navbar>
<oj-module role="main" class="oj-web-applayout-max-width oj-web-applayout-content" config="[[moduleAdapter.koObservableConfig]]">
</oj-module>
My requirement is that, the path - "sites/{siteName}" - should load a siteDetails module (siteDetails.html and siteDetails.ts) with siteName as argument
I don't want to use child routers because I want the siteDetails to be loaded in the same module as I want to keep the navbar and other things as the same. Is there a way to manually resolve all individual paths or to resolve this particular path and the other path resolution being the same ?
localhost:8000/sites - loads sites module localhost:8000/sites/my_site - Should load sitedetails module with this argument
Thanks in advance