import { NgModule } from '@angular/core' ; import { Routes } from '@angular/router' ; import { NativeScriptRouterModule } from '@nativescript/angular' ; import { ItemDetailComponent } from './item/item-detail.component' ; import { ItemsComponent } from './item/items.component' ; const routes = [ { path : '' , redirectTo : '/items' , pathMatch : 'full' } , { path : 'items' , component : ItemsComponent } , { path : 'item/:id' , component : ItemDetailComponent } ] ; @ NgModule ( { imports : [ NativeScriptRouterModule . forRoot ( routes ) ] , exports : [ NativeScriptRouterModule ] } ) export class AppRoutingModule { }