I can pass a parameter to a route and navigate there using this code:
this.router.navigateToRoute('CaseList', { RefNo: this.selectedData.RefNo
}, { replace: true })
The parameter is passed correctly to the new page.
However, I would like to open the page in a new tab. I've tried:
window.open(this.router.generate('CaseList', { RefNo:
this.selectedData.RefNo }),'_blank');
This opens a new tab and appends the parameter value to the URL e.g. http://localhost:49328/AppCaseMgmt/CaseList/20150000015, but if I try to read the value of the parameter on activation like this:
activate(params) {
console.log('activate in case list');
console.log(params.RefNo);
....
}
it's undefined.
I am adding the route dynamically to the router using
this.router.addRoute({
route: "/AppCaseMgmt/CaseList/:RefNo", name: "CaseList", moduleId: "app/case-management/case-list",
title: "CaseMgmt:CaseManagement_SiteMapHeaderCaseManagement_title" });
this.router.refreshNavigation();
but that shouldn't make a difference as far as I'm aware. (I've tried adding the route to the config.map instead but without success). I'm beginning to think this isn't possible. Has anyone any ideas?
Thanks, Anthony