title: ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'list' Error: Cannot match any routes. URL Segment: 'list'
body: <p>I have a simple app working with angular5, but I got the following error:</p>
  
  <pre><code>    ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'list'
  Error: Cannot match any routes. URL Segment: 'list'
  </code></pre>
  
  <p>I'm trying to edit the information of a client , so before all i get the list of the clients without problem ,i click edit , i get correctly all his information but when i save i should see the list of the clients , instead of that i get the above error.</p>
  
  <p>this is the structure of this component : </p>
  
  <p><a href="https://i.stack.imgur.com/Zr23T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zr23T.png" alt="enter image description here"></a></p>
  
  <p>File : client--routing.module.ts</p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  import {ClientsComponent} from './clients/clients.component';
  import {EditClientsComponent} from './clients/edit-clients/edit-clients.component';
  import {NewClientsComponent} from './new-clients/new-clients.component';
  
        const routes: Routes = [
          {
            path: '',
            pathMatch: 'full',
            data: {
              title: 'Clients'
            }
          },
          {
            path: 'list',
            pathMatch: 'full',
            component: ClientsComponent,
            data: {
              title: 'Liste des clients'
            }
          },
          {
            path: 'list/edit/:id',
            pathMatch: 'full',
            component : EditClientsComponent,
            data : {
              title: 'editer un client'
            }
          },
          {
            path: 'ajouter',
            pathMatch: 'full',
            component : NewClientsComponent,
            data: {
              title: 'Ajouter un client'
            }
          }
        ];
  
  @NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
  })
  
  export class ClientRoutingModule {}
  </code></pre>
  
  <p>File EditClientComponent.ts</p>
  
  <pre><code> import { Component, OnInit } from '@angular/core';
  import {ActivatedRoute, Router} from '@angular/router';
  import {Clients} from '../../../Models/Clients';
  import {ClientService} from '../../../../../../service/client.service';
  
  @Component({
    selector: 'app-edit-clients',
    templateUrl: './edit-clients.component.html',
    styleUrls: ['./edit-clients.component.scss']
  })
  export class EditClientsComponent implements OnInit {
  
    idClient:number;
    client:Clients = new Clients();
  
  
    constructor(public activatedRoute:ActivatedRoute ,
                public clientService:ClientService,
                public router:Router) {
      this.idClient = activatedRoute.snapshot.params['id'];
  
    }
  
    ngOnInit() {
      this.clientService.getClient(this.idClient)
        .subscribe((data:Clients)=&gt;{
          this.client=data;
        },err=&gt;{
          console.log(err);
        })
    }
  
    EditClient(){
      this.clientService.updateClient(this.client)
        .subscribe(data=&gt;{
          console.log(data);
          this.router.navigateByUrl('list');
          },err=&gt;{
          console.log(err);
          alert("Probleme");
        })
    }
  
  
  }
  </code></pre>
  
  <p>And finnaly the app.routinge.ts</p>
  
  <pre><code>  export const routes: Routes = [
    {
      path: '',
      redirectTo: 'pages',
      pathMatch: 'full',
    },
    {
      path: '',
      component: FullLayoutComponent,
      data: {
        title: 'Home'
      },
      children: [
        {
          path: 'GestionClients',
          loadChildren: './views/Admin/GestionClients/client.module#ClientModule'
        }
      ]
       }
       ];
  @NgModule({
    imports: [ RouterModule.forRoot(routes) ],
    exports: [ RouterModule ]
  })
  export class AppRoutingModule {}
  </code></pre>