-
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathapp-routing.module.ts
58 lines (54 loc) · 1.71 KB
/
app-routing.module.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
46
47
48
49
50
51
52
53
54
55
56
57
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptRouterModule, NSEmptyOutletComponent } from "@nativescript/angular";
import { FirstComponent } from "./first/first.component"
import { SecondComponent } from "./second/second.component"
import { MasterComponent } from "./second/master.component"
import { DetailComponent } from "./second/detail.component"
export const routes = [
{
path: "",
redirectTo: "/first",
pathMatch: "full"
},
{
path: "first",
component: FirstComponent,
},
{
path: "second/:depth",
component: SecondComponent,
children: [
{ path: "", component: MasterComponent },
{ path: "detail/:id", component: DetailComponent },
{
path: "lazy-named",
outlet: "lazyNameOutlet",
component: NSEmptyOutletComponent,
loadChildren: () => import('./lazy-named/lazy-named.module').then(m => m.LazyNamedModule),
}
]
},
{
path: "c-less",
children: [
{
path: "deep/:depth",
component: SecondComponent,
children: [
{ path: "", component: MasterComponent },
{ path: "detail/:id", component: DetailComponent }
]
}
]
},
{
path: "lazy",
component: NSEmptyOutletComponent,
loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule),
}
];
@NgModule({
imports: [NativeScriptRouterModule, NativeScriptRouterModule.forRoot(routes)],
exports: [NativeScriptRouterModule],
})
export class AppRoutingModule { }