I configured routing module as following:
const routes: Routes = [
{
path: "engineering/:branches",
component: BranchesTabsComponent
},
{
path: "humanities/:branches",
component: BranchesTabsComponent
},
];
and in the main-continer.component.ts:
titlesOfEngineeringTabs: string[] = ['E1','E2','E3'];
titlesOfHumanitiesTabs: string[] = ['H1','H2'];
constructor(private router: Router) {}
handleEnginTabs():void{
this.router.navigate(['/engineering', this.titlesOfEngineeringTabs]);
}
handleHumanTabs():void{
this.router.navigate(['/humanities', this.titlesOfHumanitiesTabs]);
}
and also main-continer.component.html contains:
<router-outlet></router-outlet>
and then in branches-tabs.component.ts have:
tabsLable: string[] = [''];
ngOnInit(): void {
this.route.params.subscribe(param => this.tabsLable = param["branches"]);
}
<router-outlet>
with branches-tabs component in which deferent tab labels are shown Depending on selected menu...
but I get this error:
*core.mjs:6485 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'engineering;0=%DA%A9%D8%A7%D9%85%D9%BE%DB%8C%D9%88%D8%AA%D8%B1;1=%D8%B5%D9%86%D8%A7%DB%8C%D8%B9;2=%D9%85%D8%AA%D8%A7%D9%84%D9%88%D8%B1%DA%98%DB%8C'
Error: Cannot match any routes. URL Segment: 'engineering;0=%DA%A9%D8%A7%D9%85%D9%BE%DB%8C%D9%88%D8%AA%D8%B1;1=%D8%B5%D9%86%D8%A7%DB%8C%D8%B9;2=%D9%85%D8%AA%D8%A7%D9%84%D9%88%D8%B1%DA%98%DB%8C'*
how can pass a string array as parameter and fix above error? best regards