-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
45 lines (36 loc) · 1.06 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export class App {
router: any;
configureRouter(config, router) {
this.router = router;
config.title = 'Aurelia';
// parameterized route added by map
config.map([
{
route: ['', 'home'], name: 'home',
moduleId: './home', nav: true, title: 'Home'
},
{
route: "/AppCaseMgmt/CaseList/Map/:RefNo", name: "CaseListMap", moduleId: "case-management/case-list",
title: "Test"
}
]);
// parameterized route added by addRoute
this.router.addRoute({
route: "/AppCaseMgmt/CaseList/AddRoute/:RefNo", name: "CaseListAddRoute", moduleId: "case-management/case-list",
title: "Test"
});
console.log("router configured");
}
// open in new window
click(routeName) {
window.open(this.router.generate(routeName, { RefNo: this.getRefNo() }), '_blank');
}
// navigate locally
local() {
this.router.navigateToRoute('CaseListMap', { RefNo: this.getRefNo() }, { replace: true });
}
// get a random number
getRefNo() {
return Math.floor((Math.random() * 100) + 1);
}
}