O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Get your kicks on Route 66

As we begin our journey down this highway full of adventure, let's start with a pit stop at our local service shop to ensure our vehicle is in tip-top shape. Take a turn into the root directory of app to build a new add-on to our vehicle's engine: the routing module.

Create a new routing module, app/app.routing.ts, with the following contents:

import { NgModule } from '@angular/core';import { NativeScriptRouterModule }   from 'nativescript-angular/router';import { Routes } from '@angular/router';const routes: Routes = [  {    path: '',    redirectTo: '/mixer/home',    pathMatch: 'full'  },  {    path: 'mixer',    loadChildren: () => require('./modules/mixer/mixer.module')['MixerModule']  },  {    path: 'record', loadChildren: () => require('./modules/recorder/recorder.module')['RecorderModule'] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required