Yes, you can do this using the router.navigateToRoute() method. navigateToRoute has additional parameters. Use the options parameter (third) to change the way you navigate.
Example:
import {inject} from 'aurelia-framework'; import {Router} from 'aurelia-router'; @inject(Router) export class Products { constructor(router) { this.router = router; } activate(params) {
From the documentation center :
navigateToRoute(route: string, params?: any, options?: any): boolean
It will move to a new location that matches the specified route and parameters.
Params
route: string - the name of the route used to create the navigation location.params?: any - route parameters that will be used when filling out the route template.options?: any - Navigation options.
With options you control how the story is updated.
trigger: false - Prevents the launch of the router's navigation path.replace: true - replaces the current URL in the history with the provided route (rewriting the history), so it will not start with browser feedback functions.
Miroslav popovic
source share