1. Go to src >> app >> and open app.routing.ts file and add routing like this:-
{ path: 'about/:keyword',component: AboutComponent }
For Reference: https://angular.io/guide/router
2. If you want to use this routing in component then go to src >> app >> and open component.ts file then do the followings:-
a) Add the the routing at top of the file like this:
import { Router} from '@angular/router';
constructor(private router: Router){}
b) Add in your desire component and add these line of code in your function:- For Example:-
gotoAbout(){
this.router.navigate(['/about'], { queryParams: { keyword: 'Test' } });
}
For Reference :- https://alligator.io/angular/query-parameters/