Skip to content

Instantly share code, notes, and snippets.

@saimon24
Last active July 15, 2016 15:58
Show Gist options
  • Save saimon24/bd3943c9d75518990812a420c054cd32 to your computer and use it in GitHub Desktop.
Save saimon24/bd3943c9d75518990812a420c054cd32 to your computer and use it in GitHub Desktop.
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