I'm having a secondary navigation and the data in it needs to be changed based on the route. Please find the below image.
All the data which needs to be displayed on the component is stored as below.
export const Items: SecondaryNavItems[] = [
{
icon: 'far fa-copy', title: 'Newly Added Processes'
},
{
icon: 'far fa-copy', title: 'Terminated Processes'
},
{
icon: 'far fa-copy', title: 'Test Processes'
},
{
icon: 'far fa-copy', title: 'Test Processes'
}
];
This is the component.ts file.
export class SecondaryNavigationComponent implements OnInit {
public navItems: any[];
constructor() { }
ngOnInit() {
this.navItems = Items.filter(navItem => navItem);
}
}
Could someone tell me the optimal way to achieve this?
