SlideShare a Scribd company logo
Crash Course in
AngularJS + Ionic
About Me
● Consultant (southofshasta.com)
– Software Development, Training, Design.
● Using ColdFusion since 1999 (4.x)
● Other stuff: C++, Java, jQuery, PHP, .NET, HTML5,
Android, you get the idea...
● Manager of SacInteractive User Group.
● Reformed Video Game Developer (Grim Fandango,
SimPark, StarWars Rogue Squadron, etc).
● Music Junkie.
Today's Agenda
● Intro to MVC
● Intro to AngularJS
– Some basic features, concepts and code samples.
● Intro to Ionic
– More features, code samples, etc.
● Look at some sample apps running in simulator.
● Other resources.
● Questions.
● Lunch!
Prerequisites
● Good understanding of “modern” JavaScript.
– Scopes, anonymous functions, classes, objects.
● Previous MVC experience is helpful but not
req'd.
● You'll also get exposed to:
– Node.js, PhoneGap/Cordova, mobile SDKs
(Android, Xcode, etc).
● And 1 more thing you need to know...
Prerequisites
● Know that...
– Object Oriented Programming is hard.
– This “hybrid mobile” stuff is different than what you
may be used to.
– And some of it is confusing at first.
● And that's NORMAL.
Single Page Application (SPA)
● Instead of contact.html, about.html, products.html
● You have these guys:
– Sitename.com/#/contact
– Sitename.com/#/products
● The whole site is routed through index.html via
some internal machinery.
● The whole site is downloaded at once, then
accessed via the browser cache.
● Only new data is retrieved from the server.
What is AngularJS?
● MVC framework for JavaScript SPAs.
● Very few moving parts to get started.
– Include 1 JS file, add “ng-app” to your HTML, done!
● Some nice features.
– Dependency Injection
– Routes
– 2-way Data Binding
– Various other things...
How do I get started?
● Easy!
● https://angularjs.org/
● Click “download”.
– (npm and bower options available too)
● Angular.js is all you need to start.
– (Additional JS files for fancier features. We'll get to
that later.)
How do I get started?
● <script src=”angular.js”></script>
● <html ng-app>
● {{variable name / expression}}
● [DEMO 1]
What is MVC?
● Model View Controller
● Design Pattern
● Splits your app up into 3 logical sections.
– Model – where your data and related logic goes.
– View – the parts of your app you “view” (HTML,
CSS).
– Controller – determines what happens next in the
app (some business logic maybe too).
● The “restaurant” analogy.
What is MVC?
Model
- data
- localStorage
- bus. Logic
- etc
Controller
- route user
from point a
to point b
- route user
back to point
a if Model
said
something
was missing
View
- HTML
- CSS
- jQuery
- Bootstrap
- etc.
The “Model”
● Where your data lives.
● Can be a local JS variable.
● Can come from localStorage.
● REST API.
● Some other json/ajax request.
● The app doesn't care.
● Restaurant: the kitchen.
[DEMO 2]
The “View”
● The part of the app you “view”.
– HTML, CSS, JavaScript
<html>
<body>
this part here is the “view”
</body>
</html>
● Restaurant: the menu and plates of food
The “Controller”
● Controls what happens next.
– Send info to the model.
– Update the View with an error/success message.
– Move the User to a new section of the app.
– Etc.
● Restaurant: the waiter.
[DEMO 3]
Getting data via AJAX
● $http.get() method
– Performs HTTP GET to retrieve data in JSON form.
– Could be a local file, REST, anything that returns
JSON.
[DEMO 4]
Routes
● URLs in an Angular app look like so:
– /index.html#/home
● Everything is loaded via index.html
● Each #section as it's own “view” that's
dynamically injected as the app is running.
[DEMO 5]
Custom Directives
● Basically custom tags written in AngularJS.
– <my-custom-widget />
● Works just like regular HTML tags.
● Similar to Polymer.
AngularJS
● That (in an extreme nutshell) is AngularJS.
● Can be used by itself for SPA web apps.
● Not mobile-specific.
● Now, on to Ionic...
Ionic
● Is (essentially) mobile-specific.
● Sits on top of PhoneGap and Angular.
● Built on Angular's “Directives” and “Services”.
● Also uses PhoneGap's “magic”.
● To give a Bootstrap-esque set of functionality
for hybrid mobile apps.
Ionic
● Performance “obsessed”.
– Minimal DOM manipulation
– Removed 300ms tap delay
– Etc
● Lots of other neat features.
● We'll barely scratch the surface today.
Ionic – Getting Started
● Need Node.js, Ionic packages, Cordova
packages.
● If building apps locally, need Android and
iPhone SDKs (or use PhoneGapBuild).
● Initial installation can be a bit of a pain.
– Especially if you don't run bleeding edge OS, dev
tools, etc.
Ionic – Getting Started
● To start:
– ionic start my-app [blank]
– Generates all files needed to start an app.
– “blank” is the template name. Several to pick from,
we're starting with a bare-bones app.
[DEMO 1]
– ionic start my-app tabs
– [DEMO 2]
– ionic start my-app sidemenu
– [DEMO 3]
<ion-*> tags
● <ion-*> tags
● Technically Angular directives and services
under the hood.
● The stuff that looks like Angular IS Angular.
● The <ion-*> tags are the Ionic part.
● All the AngularJS you already know works the
exact same way!
[DEMO 4]
[DEMO 5]
What's the catch?
● Same as any PhoneGap/Cordova project.
● Need to install the SDKs for each platform.
– Takes time, hassles, etc.
– Android isn't super intuitive
– IOS requires Xcode, latest OSX, etc.
Other Resources
● AngularJS.org
● Book “Pro AngularJS”
● Book “PhoneGap Mobile Application Development
Cookbook” – Matt Gifford
● IonicFramework.com
● Ionic Creator IDE
● Ionic View – easy “private QA” app
● “Powering AngularJS With RESTful services” – today at
5:30!
● Dev-Objective “A RESTful day at the SPA with Taffy and
AngularJS”, Matt Graf, CFObjective 2015.
● Ray Camden's Ionic preso from CF.O last year (title?)
Questions? Comments?
● Ways to reach me:
– Southofshasta.com
– nolan@southofshasta.com
– Twitter @southofshasta
Thanks!

More Related Content

What's hot (20)

PDF
Spa with angular
Danny Vernovsky
 
DOCX
Protractor end-to-end testing framework for angular js
codeandyou forums
 
PDF
Angular 2 overview
Jesse Warden
 
PDF
UI Testing Best Practices - An Expected Journey
Oren Farhi
 
PDF
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Oren Rubin
 
PDF
Building testable chrome extensions
Seth McLaughlin
 
PDF
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
PPTX
Test Driven Development in CQ5/AEM
Sagar Sane
 
PDF
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
PDF
Front-end Automated Testing
Ruben Teijeiro
 
PPTX
Angular UI Testing with Protractor
Andrew Eisenberg
 
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
PDF
Webdriver.io
LinkMe Srl
 
PDF
Angular 2: What's New?
jbandi
 
PDF
Front-End Testing: Demystified
Seth McLaughlin
 
PDF
Testing nightwatch, by David Torroija
David Torroija
 
PPTX
Angularjs
Sabin Tamrakar
 
PPTX
Angular1x and Angular 2 for Beginners
Oswald Campesato
 
PDF
SPA, Scalable Application & AngularJS
Mitch Chen
 
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
Spa with angular
Danny Vernovsky
 
Protractor end-to-end testing framework for angular js
codeandyou forums
 
Angular 2 overview
Jesse Warden
 
UI Testing Best Practices - An Expected Journey
Oren Farhi
 
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Oren Rubin
 
Building testable chrome extensions
Seth McLaughlin
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Test Driven Development in CQ5/AEM
Sagar Sane
 
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Front-end Automated Testing
Ruben Teijeiro
 
Angular UI Testing with Protractor
Andrew Eisenberg
 
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
Webdriver.io
LinkMe Srl
 
Angular 2: What's New?
jbandi
 
Front-End Testing: Demystified
Seth McLaughlin
 
Testing nightwatch, by David Torroija
David Torroija
 
Angularjs
Sabin Tamrakar
 
Angular1x and Angular 2 for Beginners
Oswald Campesato
 
SPA, Scalable Application & AngularJS
Mitch Chen
 
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 

Viewers also liked (20)

PDF
ITB2015 - ColdBox 4 MVC Modular Architecture
Ortus Solutions, Corp
 
PPTX
ITB2015 - NoSQL For You And Me
Ortus Solutions, Corp
 
PDF
ITB2015 - Customizing ContentBox with Themes, Widgets, and Modules, Oh My!
Ortus Solutions, Corp
 
PDF
ITB2015 - Winning with Vagrant, Puppet and Chef
Ortus Solutions, Corp
 
PDF
ITB2015 - Monitoring and Tracking Your Web Applications
Ortus Solutions, Corp
 
PDF
ORM Pink Unicorns
Ortus Solutions, Corp
 
PPTX
ITB2015 - Go Commando with CommandBox CLI
Ortus Solutions, Corp
 
PDF
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
Ortus Solutions, Corp
 
PDF
ITB2015 - Real Life ContentBox Modular CMS
Ortus Solutions, Corp
 
PDF
Object Relational Mapping with Dapper (Micro ORM)
Muhammad Umar
 
PDF
ITB2016 ContentBox CMS for a perfect project fit
Ortus Solutions, Corp
 
PPT
Sitcom quiz!
Burtoni
 
PPTX
Center for Education on Social Responsibility (CESR) Introduction
Center for Education on Social Responsibility
 
PDF
Into The Box 2016 Keynote
Ortus Solutions, Corp
 
PPTX
과제
Hye Jin Lee
 
PDF
ITB2016 - Integration testing in a modern world
Ortus Solutions, Corp
 
PPT
Саші Хортів
Наталія Дорощук
 
PPTX
ideological and material structure of Widowhood
Abhishek Sangavikar
 
PPTX
Welcome
sanoojasanooja
 
PPTX
Pitch
Duncan Warren-Rix
 
ITB2015 - ColdBox 4 MVC Modular Architecture
Ortus Solutions, Corp
 
ITB2015 - NoSQL For You And Me
Ortus Solutions, Corp
 
ITB2015 - Customizing ContentBox with Themes, Widgets, and Modules, Oh My!
Ortus Solutions, Corp
 
ITB2015 - Winning with Vagrant, Puppet and Chef
Ortus Solutions, Corp
 
ITB2015 - Monitoring and Tracking Your Web Applications
Ortus Solutions, Corp
 
ORM Pink Unicorns
Ortus Solutions, Corp
 
ITB2015 - Go Commando with CommandBox CLI
Ortus Solutions, Corp
 
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
Ortus Solutions, Corp
 
ITB2015 - Real Life ContentBox Modular CMS
Ortus Solutions, Corp
 
Object Relational Mapping with Dapper (Micro ORM)
Muhammad Umar
 
ITB2016 ContentBox CMS for a perfect project fit
Ortus Solutions, Corp
 
Sitcom quiz!
Burtoni
 
Center for Education on Social Responsibility (CESR) Introduction
Center for Education on Social Responsibility
 
Into The Box 2016 Keynote
Ortus Solutions, Corp
 
과제
Hye Jin Lee
 
ITB2016 - Integration testing in a modern world
Ortus Solutions, Corp
 
Саші Хортів
Наталія Дорощук
 
ideological and material structure of Widowhood
Abhishek Sangavikar
 
Ad

Similar to ITB2015 - Crash Course in Ionic + AngularJS (20)

PDF
Crash Course in AngularJS + Ionic (Deep dive)
ColdFusionConference
 
PPTX
Django simplified : by weever mbakaya
Mbakaya Kwatukha
 
PPTX
Angular Js
Knoldus Inc.
 
PPTX
Nodejs web service for starters
Bruce Li
 
PDF
Philip Shurpik "Architecting React Native app"
Fwdays
 
PDF
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Codemotion
 
PPTX
Angular kickstart slideshare
SaleemMalik52
 
PPTX
Web worker in your angular application
Suresh Patidar
 
PPTX
20190826 ianjoseph_FinalPresentation
Ian Joseph
 
PPTX
Final presentation aldy ian - pwa
Muhamad Aldy Bintang
 
PDF
Dust.js
Yevgeniy Brikman
 
PDF
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Sauce Labs
 
PPTX
Angular JS, A dive to concepts
Abhishek Sur
 
PPTX
Intro to AngularJs
SolTech, Inc.
 
PDF
AngularJS 101
Houssem Yahiaoui
 
PPTX
Start your journey with angular | Basic Angular
Anwarul Islam
 
PPTX
Angular
TejinderMakkar
 
PDF
AngularJS A comprehensive beginner s guide to angular js 3nd Edition Rufus St...
vivaanpulcha
 
PDF
AngularJS in Production (CTO Forum)
Alex Ross
 
PPTX
L4-AndroidProgramming presentation for student
vimalpcwork
 
Crash Course in AngularJS + Ionic (Deep dive)
ColdFusionConference
 
Django simplified : by weever mbakaya
Mbakaya Kwatukha
 
Angular Js
Knoldus Inc.
 
Nodejs web service for starters
Bruce Li
 
Philip Shurpik "Architecting React Native app"
Fwdays
 
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Codemotion
 
Angular kickstart slideshare
SaleemMalik52
 
Web worker in your angular application
Suresh Patidar
 
20190826 ianjoseph_FinalPresentation
Ian Joseph
 
Final presentation aldy ian - pwa
Muhamad Aldy Bintang
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Sauce Labs
 
Angular JS, A dive to concepts
Abhishek Sur
 
Intro to AngularJs
SolTech, Inc.
 
AngularJS 101
Houssem Yahiaoui
 
Start your journey with angular | Basic Angular
Anwarul Islam
 
AngularJS A comprehensive beginner s guide to angular js 3nd Edition Rufus St...
vivaanpulcha
 
AngularJS in Production (CTO Forum)
Alex Ross
 
L4-AndroidProgramming presentation for student
vimalpcwork
 
Ad

More from Ortus Solutions, Corp (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
Ortus Solutions, Corp
 
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
What's New with BoxLang Led by Brad Wood.pdf
Ortus Solutions, Corp
 
PDF
Vector Databases and the BoxLangCFML Developer.pdf
Ortus Solutions, Corp
 
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Ortus Solutions, Corp
 
PDF
Use JSON to Slash Your Database Performance.pdf
Ortus Solutions, Corp
 
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Ortus Solutions, Corp
 
PDF
Supercharging CommandBox with Let's Encrypt.pdf
Ortus Solutions, Corp
 
PDF
Spice up your site with cool animations using GSAP..pdf
Ortus Solutions, Corp
 
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
Ortus Solutions, Corp
 
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Ortus Solutions, Corp
 
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Ortus Solutions, Corp
 
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Ortus Solutions, Corp
 
PDF
Geting-started with BoxLang Led By Raymon Camden.pdf
Ortus Solutions, Corp
 
PDF
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ortus Solutions, Corp
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
June Webinar: BoxLang-Dynamic-AWS-Lambda
Ortus Solutions, Corp
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
Ortus Solutions, Corp
 
What's New with BoxLang Led by Brad Wood.pdf
Ortus Solutions, Corp
 
Vector Databases and the BoxLangCFML Developer.pdf
Ortus Solutions, Corp
 
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Ortus Solutions, Corp
 
Use JSON to Slash Your Database Performance.pdf
Ortus Solutions, Corp
 
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Ortus Solutions, Corp
 
Supercharging CommandBox with Let's Encrypt.pdf
Ortus Solutions, Corp
 
Spice up your site with cool animations using GSAP..pdf
Ortus Solutions, Corp
 
Passkeys and cbSecurity Led by Eric Peterson.pdf
Ortus Solutions, Corp
 
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Ortus Solutions, Corp
 
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Ortus Solutions, Corp
 
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Ortus Solutions, Corp
 
Geting-started with BoxLang Led By Raymon Camden.pdf
Ortus Solutions, Corp
 
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ortus Solutions, Corp
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 

ITB2015 - Crash Course in Ionic + AngularJS

  • 2. About Me ● Consultant (southofshasta.com) – Software Development, Training, Design. ● Using ColdFusion since 1999 (4.x) ● Other stuff: C++, Java, jQuery, PHP, .NET, HTML5, Android, you get the idea... ● Manager of SacInteractive User Group. ● Reformed Video Game Developer (Grim Fandango, SimPark, StarWars Rogue Squadron, etc). ● Music Junkie.
  • 3. Today's Agenda ● Intro to MVC ● Intro to AngularJS – Some basic features, concepts and code samples. ● Intro to Ionic – More features, code samples, etc. ● Look at some sample apps running in simulator. ● Other resources. ● Questions. ● Lunch!
  • 4. Prerequisites ● Good understanding of “modern” JavaScript. – Scopes, anonymous functions, classes, objects. ● Previous MVC experience is helpful but not req'd. ● You'll also get exposed to: – Node.js, PhoneGap/Cordova, mobile SDKs (Android, Xcode, etc). ● And 1 more thing you need to know...
  • 5. Prerequisites ● Know that... – Object Oriented Programming is hard. – This “hybrid mobile” stuff is different than what you may be used to. – And some of it is confusing at first. ● And that's NORMAL.
  • 6. Single Page Application (SPA) ● Instead of contact.html, about.html, products.html ● You have these guys: – Sitename.com/#/contact – Sitename.com/#/products ● The whole site is routed through index.html via some internal machinery. ● The whole site is downloaded at once, then accessed via the browser cache. ● Only new data is retrieved from the server.
  • 7. What is AngularJS? ● MVC framework for JavaScript SPAs. ● Very few moving parts to get started. – Include 1 JS file, add “ng-app” to your HTML, done! ● Some nice features. – Dependency Injection – Routes – 2-way Data Binding – Various other things...
  • 8. How do I get started? ● Easy! ● https://angularjs.org/ ● Click “download”. – (npm and bower options available too) ● Angular.js is all you need to start. – (Additional JS files for fancier features. We'll get to that later.)
  • 9. How do I get started? ● <script src=”angular.js”></script> ● <html ng-app> ● {{variable name / expression}} ● [DEMO 1]
  • 10. What is MVC? ● Model View Controller ● Design Pattern ● Splits your app up into 3 logical sections. – Model – where your data and related logic goes. – View – the parts of your app you “view” (HTML, CSS). – Controller – determines what happens next in the app (some business logic maybe too). ● The “restaurant” analogy.
  • 11. What is MVC? Model - data - localStorage - bus. Logic - etc Controller - route user from point a to point b - route user back to point a if Model said something was missing View - HTML - CSS - jQuery - Bootstrap - etc.
  • 12. The “Model” ● Where your data lives. ● Can be a local JS variable. ● Can come from localStorage. ● REST API. ● Some other json/ajax request. ● The app doesn't care. ● Restaurant: the kitchen. [DEMO 2]
  • 13. The “View” ● The part of the app you “view”. – HTML, CSS, JavaScript <html> <body> this part here is the “view” </body> </html> ● Restaurant: the menu and plates of food
  • 14. The “Controller” ● Controls what happens next. – Send info to the model. – Update the View with an error/success message. – Move the User to a new section of the app. – Etc. ● Restaurant: the waiter. [DEMO 3]
  • 15. Getting data via AJAX ● $http.get() method – Performs HTTP GET to retrieve data in JSON form. – Could be a local file, REST, anything that returns JSON. [DEMO 4]
  • 16. Routes ● URLs in an Angular app look like so: – /index.html#/home ● Everything is loaded via index.html ● Each #section as it's own “view” that's dynamically injected as the app is running. [DEMO 5]
  • 17. Custom Directives ● Basically custom tags written in AngularJS. – <my-custom-widget /> ● Works just like regular HTML tags. ● Similar to Polymer.
  • 18. AngularJS ● That (in an extreme nutshell) is AngularJS. ● Can be used by itself for SPA web apps. ● Not mobile-specific. ● Now, on to Ionic...
  • 19. Ionic ● Is (essentially) mobile-specific. ● Sits on top of PhoneGap and Angular. ● Built on Angular's “Directives” and “Services”. ● Also uses PhoneGap's “magic”. ● To give a Bootstrap-esque set of functionality for hybrid mobile apps.
  • 20. Ionic ● Performance “obsessed”. – Minimal DOM manipulation – Removed 300ms tap delay – Etc ● Lots of other neat features. ● We'll barely scratch the surface today.
  • 21. Ionic – Getting Started ● Need Node.js, Ionic packages, Cordova packages. ● If building apps locally, need Android and iPhone SDKs (or use PhoneGapBuild). ● Initial installation can be a bit of a pain. – Especially if you don't run bleeding edge OS, dev tools, etc.
  • 22. Ionic – Getting Started ● To start: – ionic start my-app [blank] – Generates all files needed to start an app. – “blank” is the template name. Several to pick from, we're starting with a bare-bones app. [DEMO 1] – ionic start my-app tabs – [DEMO 2] – ionic start my-app sidemenu – [DEMO 3]
  • 23. <ion-*> tags ● <ion-*> tags ● Technically Angular directives and services under the hood. ● The stuff that looks like Angular IS Angular. ● The <ion-*> tags are the Ionic part. ● All the AngularJS you already know works the exact same way! [DEMO 4] [DEMO 5]
  • 24. What's the catch? ● Same as any PhoneGap/Cordova project. ● Need to install the SDKs for each platform. – Takes time, hassles, etc. – Android isn't super intuitive – IOS requires Xcode, latest OSX, etc.
  • 25. Other Resources ● AngularJS.org ● Book “Pro AngularJS” ● Book “PhoneGap Mobile Application Development Cookbook” – Matt Gifford ● IonicFramework.com ● Ionic Creator IDE ● Ionic View – easy “private QA” app ● “Powering AngularJS With RESTful services” – today at 5:30! ● Dev-Objective “A RESTful day at the SPA with Taffy and AngularJS”, Matt Graf, CFObjective 2015. ● Ray Camden's Ionic preso from CF.O last year (title?)
  • 26. Questions? Comments? ● Ways to reach me: – Southofshasta.com – [email protected] – Twitter @southofshasta Thanks!