I'm looking to enhance my URL by adding a new parameter, but I'm unsure of the steps needed.
ts.file
route(name:string) {
this.router.navigate(['/homepage', (name)]);
console.log('name);
}
service
private url1 = './assets/json/one/first.json'
constructor(private http: HttpCient) {}
get(): Observable<Itoto[]> {
return this.http.get<Itoto[]>(this.url1);
}
getRoute() {
this.activatedRoute.paramMap.subscribe(params => {
this.result = params.get('toto'); // need to insert 'toto' into the URL like './assets/json/toto/first.json'
}
}