I want to set a route parameter into my route title.
Basically, I want to make something like this:
configureRouter(config: RouterConfiguration, router: Router): void {
config.map([
{
route: ":var1",
name: "myName",
title: "my title" + " n° " + ":var1",
moduleId: "x/y/z"
}
]);
}
I want to concatenate strings with my route parameter where var1
is my route parameter.
How can I do this?
Not when you define the router config.
But in the component itself, when it loads up, you can mutate title.
export class Z {
activate(params, routeConfig) {
routeConfig.navModel.setTitle("my title" + " n° " + params.val1);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.