I'm trying to build a tab menu in Angular (v2.4.5) . A tab is active based on the route.
For example I have this routes:
const routes: Routes = [
{
path: 'tab1',
component: Tab1Component,
},
{
path: 'tab2',
component: Tab2Component,
}
];
if the user enters the address http://localhost/tab2
I want tab2
to be highlighted ( change tab css).
What is the best approach to achieve this?