Thanks for the reference @Tristan_Bastian
I have created one plugin for custom cockpit by setting application options and by help of feature module. This plugin has multiple pages like Create, Edit & view but not child components.
Feature Module
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from "@angular/router";
import { listreports } from './listreports.component';
import { createReport} from './createReport.component';
import { editReport } from './editReport.compnent';
import { viewReport } from './viewReport.component';
import { CoreModule, hookNavigator, hookRoute } from '@c8y/ngx-components';
import { NavigationFactory } from './reportconfig-manager.factory';
import { CommonModule } from '@angular/common';
const routes: Routes = [
{
path: 'my-reports',
component: listreports
},
{
path: "create",
component: createReport
},
{
path: "edit/:id",
component: editReport
},
{
path: "view/:id",
component: viewReport
}
];
@NgModule({
imports: [
CoreModule,
CommonModule,
RouterModule.forChild(routes)],
exports: [],
declarations: [AutomatedReportComponent, CreateReportComponent, EditReportComponent, ViewReportComponent],
providers: [
hookNavigator(NavigationFactory),
hookRoute({
path: 'my-reports',
component: listreports
}),
],
})
export class AutomatedReportModule { }
Navigation Factory file
import { Injectable } from '@angular/core';
import { NavigatorNode, NavigatorNodeFactory } from '@c8y/ngx-components';
@Injectable()
export class NavigationFactory implements NavigatorNodeFactory {
constructor() { }
private readonly FAVORITES_LIST_NAVIGATOR_NODE = new NavigatorNode({
label: 'My Reports',
path: 'my-reports',
icon: 'email-document',
priority: 2000,
routerLinkExact: false,
});
get() {
return this.FAVORITES_LIST_NAVIGATOR_NODE;
}
}
Whenever I go my-reports path I can see that My Reports node is active under the side menu. when I navigate to other paths like createReport or Edit My Reports node is not in active state I tried by setting
routerLinkExact: false,
Version: 1018.0.240
Is there any other way to set that node active ?
Regards
Mohan