Last active
July 15, 2016 15:58
-
-
Save saimon24/bd3943c9d75518990812a420c054cd32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from "@angular/core"; | |
import {RouterConfig} from "@angular/router"; | |
import {NS_ROUTER_DIRECTIVES, nsProvideRouter} from "nativescript-angular/router"; | |
import {ListPage} from "./pages/list/list.component"; | |
import {PokemonPage} from "./pages/pokemon/pokemon.component"; | |
@Component({ | |
moduleId: module.id, | |
selector: "my-app", | |
directives: [NS_ROUTER_DIRECTIVES], | |
template: ` | |
<StackLayout> | |
<page-router-outlet></page-router-outlet> | |
</StackLayout> | |
` | |
}) | |
export class AppComponent { | |
} | |
export const APP_ROUTES: RouterConfig = [ | |
{ path: "", component: ListPage }, | |
{ path: "pokemon/:url", component: PokemonPage } | |
]; | |
export const APP_ROUTER_PROVIDERS = nsProvideRouter( | |
APP_ROUTES, | |
{ enableTracing: false } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment