You can do this with this code:
import { Router } from '@angular/router'; ... constructor(private router: Router) {} changeRoute () { this.router.navigate(['/results', { dateFrom: this.dateFrom, page: this.page }]); } ...
Take a look at the stackblitz demo .
See the router API for more information . navigate .
source share