Different routes same component

you can solve it by adding routes

const routes: Routes = [
    { path: 'experience',
        children: [
            { path: 'pending', component: ExperienceComponent },
            { path: 'requests', component: ExperienceComponent },
        ] }]

and in ExperienceComponent import

import { ActivatedRoute } from "@angular/router";

and in constructor add this parameter

constructor(public route: ActivatedRoute)

and inside constructor get url

this.route.url.subscribe(params => {
  console.log(params[0].path);
})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)