-
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathconfig-snippets.ts
36 lines (32 loc) · 973 Bytes
/
config-snippets.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
import { NgModule } from "@angular/core";
// Just fake routes for config snippets
class LoginComponent { }
class GroceryListComponent { }
class GroceryComponent { }
class GroceriesApp { }
// >> router-config
export const routes = [
{ path: "login", component: LoginComponent },
{ path: "groceries", component: GroceryListComponent },
{ path: "grocery/:id", component: GroceryComponent }
];
// << router-config
// >> router-provider
import { NativeScriptRouterModule } from "nativescript-angular/router";
@NgModule({
bootstrap: [GroceriesApp],
imports: [
NativeScriptRouterModule,
NativeScriptRouterModule.forRoot(routes)
]
})
export class GroceriesAppModule { }
// << router-provider
// >> router-bootstrap
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
// >> (hide)
function start_snippet() {
// << (hide)
platformNativeScriptDynamic().bootstrapModule(GroceriesAppModule);
// << router-bootstrap
}