I am currently working on creating a tab menu using Angular (v2.4.5). The active tab is determined by the route.
Here are some example routes:
const routes: Routes = [
{
path: 'tab1',
component: Tab1Component,
},
{
path: 'tab2',
component: Tab2Component,
}
];
If a user navigates to http://localhost/tab2
, I want the tab2
to be highlighted (change tab CSS).
What would be the most effective way to achieve this?