SlideShare a Scribd company logo
1 of 34
NativeScript and Angular 2,
Sitting in a Tree
Jen Looper (Telerik DevRel)
@jenlooper
• Ph.D. … in Medieval French (13th
century prose romance FTW)
• Retrained!
• Worked in startup, nonprofit,
big corporate 14 yrs+
• A lot of side projects
ladeezfirstmedia.com
• Now DevRel@Telerik
• I’m a developer & I like mobile apps!
I like NativeScript
Tobias Bosch Hristo Deshev
What is NativeScript?
• A runtime for building and running native iOS,
Android, and (soon) Windows Phone apps with a
single, JavaScript code base
• No cross
compilation
!=
• Direct access to
native APIs in JS
!=
!=
• No DOM
Why NativeScript?
• Skills reuse
• JavaScript and CSS
• Angular2
• Code reuse
• npm modules, 3rd-party iOS and Android libraries
• Easily use native APIs
• No wrappers to access native APIs
• Use native UI elements
• Open source!
• Bridge
NativeScript Android example
Output:
NativeScript iOS example
How does this even?
JavaScript Virtual Machine
But…who wants to write native iOS or
Android code?
NativeScript modules
Code Modules Platform API
2016
NativeScript file module
HTTP module example
Why NativeScript + Angular 2?
• Angular 1 = a technology that relies on browser tech to
manipulate the DOM.
• NativeScript has no DOM to manipulate
• Angular 2 decoupled the Angular framework from the
DOM
• The door is open to new mobile-friendly tech to
leverage this newly decoupled framework!!
A standard {N} app snippet
<!-- main.xml -->
<page>
<StackLayout>
<Button text= "Hello World" tap= "showAlert" />
</StackLayout>
</page>
/* main.js */
var dialogs = require("ui/dialogs");
exports.showAlert = function() {
dialogs.alert({ message: "NativeScript rocks!" });
};
Same functionality, {N} + ng2
// main.ts
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {Component, View} from "angular2/angular2";
import {dialogs} from "ui/dialogs";
@Component({})
@View({
directives: [],
template: `
<stack-layout>
<button
(tap)="showAlert()"
text="Hello World"></button>
</stack-layout>
`
})
class HelloPage {
showAlert() {
dialogs.alert({ message: "NativeScript rocks!" });
}
}
export function loaded() {
nativeScriptBootstrap(HelloPage, []);
}
Destination
Implementation
Abstraction
Layer
The big picture
XMLHttpRequest
<NS Module>
Native
iOS call
Native
Android call
iOS App Android App
Destination
Implementation
Abstraction
Layer
The bigger picture ({N}+NG2)
HTTP
<Angular Component>
XMLHttpRequest
<NS Module>
Native
iOS call
Native
Android call
Ajax call
iOS App Android App Web App
XMLHttpRequest
<Browser>
One syntax for all
Attribute Binding: [attribute]
Event Binding: (event)
Intercepting input: #idhandler
Conditions: *ng-if="expression"
Loops: *ng-for="expression"
Styling: [class.style1]="expression"
The difference is in the UI
Web UI != Mobile UI
Native Layouts
Absolute Dock Grid Stack Wrap
Let’s take it for a spin!
Use a template to create a sample app:
$ tns create myNewAngularApp --template
https://github.com/NativeScript/template-hello-world-ng
$ tns emulate ios
Clone a repo:
TodoMVC – git clone
https://github.com/NativeScript/sample-ng-todomvc
$ npm install
$ tns platform add ios
$ tns platform add ios
$ tns emulate ios
PocketRave
https://github.com/jlooper/pocketrave-app
Learn more & enjoy!
NativeScript.org
NativeScript Slack Community
http://bit.ly/nativescript-slack
Really useful article: http://bit.ly/n-ng2
@nativescript
@jenlooper

More Related Content

Similar to Angular 2 and NativeScript

Native Script Atlanta Code Camp
Native Script Atlanta Code CampNative Script Atlanta Code Camp
Native Script Atlanta Code CampBaskar rao Dsn
 
Game On With NativeScript
Game On With NativeScriptGame On With NativeScript
Game On With NativeScriptJen Looper
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidChris Hardy
 
Native script overview
Native script overviewNative script overview
Native script overviewBaskar rao Dsn
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyUlrich Krause
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to GoOliver N
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_uDoris Chen
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsJohn M. Wargo
 
Kirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIKirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIjhugman
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
The Javascript Ecosystem
The Javascript EcosystemThe Javascript Ecosystem
The Javascript EcosystemEmmanuel Akinde
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Bala Subra
 
Native script overview
Native script overviewNative script overview
Native script overviewBaskar rao Dsn
 
Cross-Platform Native Apps with JavaScript
Cross-Platform Native Apps with JavaScriptCross-Platform Native Apps with JavaScript
Cross-Platform Native Apps with JavaScriptFokke Zandbergen
 

Similar to Angular 2 and NativeScript (20)

Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Native Script Atlanta Code Camp
Native Script Atlanta Code CampNative Script Atlanta Code Camp
Native Script Atlanta Code Camp
 
Game On With NativeScript
Game On With NativeScriptGame On With NativeScript
Game On With NativeScript
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for Android
 
Native script overview
Native script overviewNative script overview
Native script overview
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Golang #5: To Go or not to Go
Golang #5: To Go or not to GoGolang #5: To Go or not to Go
Golang #5: To Go or not to Go
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
JavaScript on the Desktop
JavaScript on the DesktopJavaScript on the Desktop
JavaScript on the Desktop
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
React Native
React NativeReact Native
React Native
 
Kirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIKirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UI
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
The Javascript Ecosystem
The Javascript EcosystemThe Javascript Ecosystem
The Javascript Ecosystem
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
 
Node azure
Node azureNode azure
Node azure
 
Native script overview
Native script overviewNative script overview
Native script overview
 
Cross-Platform Native Apps with JavaScript
Cross-Platform Native Apps with JavaScriptCross-Platform Native Apps with JavaScript
Cross-Platform Native Apps with JavaScript
 

More from Jen Looper

Staying Fresh and Avoiding Burnout
Staying Fresh and Avoiding BurnoutStaying Fresh and Avoiding Burnout
Staying Fresh and Avoiding BurnoutJen Looper
 
Sharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile AppsSharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile AppsJen Looper
 
Beacons, Plants, Boxes
Beacons, Plants, BoxesBeacons, Plants, Boxes
Beacons, Plants, BoxesJen Looper
 
Hackathon Slides
Hackathon SlidesHackathon Slides
Hackathon SlidesJen Looper
 
Using Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT NearablesUsing Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT NearablesJen Looper
 
Swipe Left for NativeScript
Swipe Left for NativeScriptSwipe Left for NativeScript
Swipe Left for NativeScriptJen Looper
 
Crafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya MysteryCrafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya MysteryJen Looper
 
Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!Jen Looper
 
Building a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy StepsBuilding a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy StepsJen Looper
 
Becoming a Green Developer
Becoming a Green DeveloperBecoming a Green Developer
Becoming a Green DeveloperJen Looper
 
Azure Static Web Apps
Azure Static Web AppsAzure Static Web Apps
Azure Static Web AppsJen Looper
 
Creating a Great Workshop
Creating a Great WorkshopCreating a Great Workshop
Creating a Great WorkshopJen Looper
 
The Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's GuideThe Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's GuideJen Looper
 
Zero to Hipster with the M.I.K.E. Stack
Zero to Hipster with the M.I.K.E. StackZero to Hipster with the M.I.K.E. Stack
Zero to Hipster with the M.I.K.E. StackJen Looper
 
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXTTelerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXTJen Looper
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceJen Looper
 

More from Jen Looper (16)

Staying Fresh and Avoiding Burnout
Staying Fresh and Avoiding BurnoutStaying Fresh and Avoiding Burnout
Staying Fresh and Avoiding Burnout
 
Sharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile AppsSharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile Apps
 
Beacons, Plants, Boxes
Beacons, Plants, BoxesBeacons, Plants, Boxes
Beacons, Plants, Boxes
 
Hackathon Slides
Hackathon SlidesHackathon Slides
Hackathon Slides
 
Using Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT NearablesUsing Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT Nearables
 
Swipe Left for NativeScript
Swipe Left for NativeScriptSwipe Left for NativeScript
Swipe Left for NativeScript
 
Crafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya MysteryCrafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya Mystery
 
Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!
 
Building a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy StepsBuilding a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy Steps
 
Becoming a Green Developer
Becoming a Green DeveloperBecoming a Green Developer
Becoming a Green Developer
 
Azure Static Web Apps
Azure Static Web AppsAzure Static Web Apps
Azure Static Web Apps
 
Creating a Great Workshop
Creating a Great WorkshopCreating a Great Workshop
Creating a Great Workshop
 
The Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's GuideThe Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's Guide
 
Zero to Hipster with the M.I.K.E. Stack
Zero to Hipster with the M.I.K.E. StackZero to Hipster with the M.I.K.E. Stack
Zero to Hipster with the M.I.K.E. Stack
 
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXTTelerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 

Angular 2 and NativeScript

  • 1. NativeScript and Angular 2, Sitting in a Tree Jen Looper (Telerik DevRel) @jenlooper
  • 2. • Ph.D. … in Medieval French (13th century prose romance FTW) • Retrained! • Worked in startup, nonprofit, big corporate 14 yrs+ • A lot of side projects ladeezfirstmedia.com • Now DevRel@Telerik
  • 3. • I’m a developer & I like mobile apps!
  • 5.
  • 7.
  • 8. What is NativeScript? • A runtime for building and running native iOS, Android, and (soon) Windows Phone apps with a single, JavaScript code base
  • 9.
  • 10. • No cross compilation != • Direct access to native APIs in JS != != • No DOM
  • 11. Why NativeScript? • Skills reuse • JavaScript and CSS • Angular2 • Code reuse • npm modules, 3rd-party iOS and Android libraries • Easily use native APIs • No wrappers to access native APIs • Use native UI elements • Open source!
  • 15.
  • 16. How does this even?
  • 18.
  • 19. But…who wants to write native iOS or Android code?
  • 20.
  • 24. Why NativeScript + Angular 2? • Angular 1 = a technology that relies on browser tech to manipulate the DOM. • NativeScript has no DOM to manipulate • Angular 2 decoupled the Angular framework from the DOM • The door is open to new mobile-friendly tech to leverage this newly decoupled framework!!
  • 25. A standard {N} app snippet <!-- main.xml --> <page> <StackLayout> <Button text= "Hello World" tap= "showAlert" /> </StackLayout> </page> /* main.js */ var dialogs = require("ui/dialogs"); exports.showAlert = function() { dialogs.alert({ message: "NativeScript rocks!" }); };
  • 26. Same functionality, {N} + ng2 // main.ts import {nativeScriptBootstrap} from "nativescript-angular/application"; import {Component, View} from "angular2/angular2"; import {dialogs} from "ui/dialogs"; @Component({}) @View({ directives: [], template: ` <stack-layout> <button (tap)="showAlert()" text="Hello World"></button> </stack-layout> ` }) class HelloPage { showAlert() { dialogs.alert({ message: "NativeScript rocks!" }); } } export function loaded() { nativeScriptBootstrap(HelloPage, []); }
  • 27. Destination Implementation Abstraction Layer The big picture XMLHttpRequest <NS Module> Native iOS call Native Android call iOS App Android App
  • 28. Destination Implementation Abstraction Layer The bigger picture ({N}+NG2) HTTP <Angular Component> XMLHttpRequest <NS Module> Native iOS call Native Android call Ajax call iOS App Android App Web App XMLHttpRequest <Browser>
  • 29. One syntax for all Attribute Binding: [attribute] Event Binding: (event) Intercepting input: #idhandler Conditions: *ng-if="expression" Loops: *ng-for="expression" Styling: [class.style1]="expression"
  • 30. The difference is in the UI Web UI != Mobile UI
  • 31. Native Layouts Absolute Dock Grid Stack Wrap
  • 32. Let’s take it for a spin! Use a template to create a sample app: $ tns create myNewAngularApp --template https://github.com/NativeScript/template-hello-world-ng $ tns emulate ios
  • 33. Clone a repo: TodoMVC – git clone https://github.com/NativeScript/sample-ng-todomvc $ npm install $ tns platform add ios $ tns platform add ios $ tns emulate ios PocketRave https://github.com/jlooper/pocketrave-app
  • 34. Learn more & enjoy! NativeScript.org NativeScript Slack Community http://bit.ly/nativescript-slack Really useful article: http://bit.ly/n-ng2 @nativescript @jenlooper