Move, Shake and Drop with

NativeScript and Angular


Jen Looper

Senior Developer Advocate, Progress


You need a web site

And a mobile app

...for iOS

...and Android

oh and also a Desktop app

U got this

•Multiple codebases

•Fragmented platforms

•Multiple language choices and IDEs

•Keeping features in sync

Building for multiple platforms is hard!

You need...a seed!

But you can do it

An all-purpose seed

  • It's for web!
  • It's for iOS!
  • It's for Android!
  • It can do the dishes!

by Meet Maestro*

*Sean Perkins, Developer Expert

web app

mobile app


  • i18n Translations
  • Lazy Loaded Modules
  • Angular CLI
  • Webpack
  • Testing
  • Target Phone and Tablet Templates Individually

Focus on building mobile apps:

What is NativeScript?

A framework for building native cross-platform mobile apps...


No-compromise, smoothly-animating native mobile apps for iOS and Android

NativeScript is...

Just JavaScript!

You know JavaScript? You know NativeScript!


Use JavaScript, CSS, XML to construct the app

Let's build!

Build your web app

  • Fork the Maestro Seed
  • npm i
  • ng serve
  • start building!

Folder structure

work in /src

page folders

web = .html

mobile = .tns.html

a 'Web First' seed:

Events only exists on mobile: needs separate .tns modules and routing modules (web build disregards)

Lightshow only exists on web: mobile app needs empty .tns files to webpack properly

Idea: share what code you can on the component level, and create separate .tns files for mobile when needed.

Build for mobile

symlinks copy code into /nativescript folder

Build for mobile

add mobile assets to App_Resources

builds occur here

code sample

Routing module, split

// angular
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
// app
import { EventsRoutes } from './events.routes';

    imports: [
    exports: [RouterModule]
export class EventsRoutingModule { }
// angular
import { NgModule } from '@angular/core';
import { NativeScriptRouterModule } from 'nativescript-angular';
// app
import { EventsRoutes } from './events.routes';

    imports: [
    exports: [NativeScriptRouterModule]
export class EventsRoutingModule { }



code sample

presentation tier

<div class="content">
    <ul class="actions">
        <li (click)="startLightShow('rainbow')"><a class="button special rainbow">Start a Rainbow light show!</a></li>
        <li (click)="startLightShow('red')"><a class="button special red">Start a Red light show!</a></li>
        <li (click)="startLightShow('blue')"><a class="button special blue">Start a Blue light show!</a></li>
        <li (click)="startLightShow('green')"><a class="button special green">Start a Green light show!</a></li>
        <li (click)="startLightShow('clear')"><a class="button special black ">End light show</a></li>
<ActionBar title="Events"></ActionBar>
   <StackLayout *ngFor="let event of (events$ | async)">
      <Button class="blue" [text]="" (tap)="chooseEvent("></Button>



Into the future!

Coming soon!

Integration with Angular CLI - stay tuned!

party time!

Made with