import { NgModule } from "@angular/core" ; import { NativeScriptRouterModule } from "nativescript-angular/router" ; import { Routes } from "@angular/router" ; import { LoginComponent } from "./login/login.component" ; import { MainPageComponent } from "./main-page/main-page.component" ; const routes = [ { path : "" , redirectTo : "/login" , pathMatch : "full" } , { path : "login" , component : LoginComponent } , { path : "main-page/:username" , component : MainPageComponent } , ] ; @ NgModule ( { imports : [ NativeScriptRouterModule . forRoot ( routes ) ] , exports : [ NativeScriptRouterModule ] } ) export class AppRoutingModule { }