is this.router.url browser dependent code example

Example 1: home page routing in angular

const routes: Routes = [
  { path: 'home_page_path', component: HomePageComponent }

];
add this in app routing file
/*
I Hope it will Help You.
Namaste _/\_
*/

Example 2: child path angular

const routes: Routes = [
  {
    path: 'first-component',
    component: FirstComponent, // this is the component with the <router-outlet> in the template
    children: [
      {
        path: 'child-a', // child route path
        component: ChildAComponent, // child route component that the router renders
      },
      {
        path: 'child-b',
        component: ChildBComponent, // another child route component that the router renders
      },
    ],
  },
];