I want to set a base header value for my Aurelia application and then add a value to it based on the active route.
My router configuration:
export class App { configureRouter(config, router) { config.title = 'Brandon Taylor | Web Developer | Graphic Designer'; config.map([ . . . { route: 'work', name: 'work', moduleId: 'work', nav: true, title: ' | work' }, . . . ]); this.router = router; } }
Aurelia wants to add a title navigation parameter to the beginning of config.title , but I would like it at the end.
I tried to make an override in the view model:
export class Work { activate(params, routeConfig, navigationInstruction) { routeConfig.navModel.router.title += ' | work'; }; }
but this leads to:
Brandon Taylor | Web Developer | Graphic Designer | work | work | work ...
for each routing request. What am I doing wrong? or how to add the route attribute title to the end of config.title instead of the start?
source share