Q: Angular route navigation with variable param I have some routes in my app.module.ts :
 {path: 'infos/:lang', loadChildren: './base-infos/base-infos.module#BaseInfosModule' },
  {path: '', redirectTo: 'infos/fr', pathMatch: 'full' }

And iam calling the first route in my code :
this._router.navigate(['infos/', this.currentLang ])

If i choose the language english, so "this.currentLang" equals to "en" in the url "infos/en". The issue is, even if i choose "en" it always leads me to "infos/fr" instead of "infos/en".
Is there any reason why my code is doing this ???
thanks

A: for first try place the route with path: '' above the another route, like that:
{path: '', redirectTo: 'infos/fr', pathMatch: 'full' }, 
{path: 'infos/:lang', loadChildren: './base-infos/base-infos.module#BaseInfosModule' }

or also try this router.navigate function:
this._router.navigate([`infos/${ this.currentLang }`]);

or also you can try it without the / symbol:
this._router.navigate(['infos', this.currentLang ]);


A: You don't need trailing '/' in navigate call. Try below line
this._router.navigate(['infos', this.currentLang ])

