SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
ionic 
Building Mobile Apps with Ionic 
An Introduction By Morris Singer
WHO AM I 
• Senior Software Engineer 
Cengage Learning 
• Technical Cofounder & General Counsel 
UnionConnect 
• Sencha Touch (Two Years) 
• Angular.js and Node.js (One Year) 
• Ruby on Rails (Four Years) 
• Previously…
AGENDA 
• Put Ionic in context 
• Make the case for Ionic 
• Review the Ionic technology stack 
• Explore some Ionic components 
• Q & A
WHAT’S IN A FRAMEWORK 
Behind the Design of a Framework Rests a Philosophy about the Roles of Javascript and HTML 
ionic DOM Manipulation 
Two-Way Data Binding JavaScript-Centric
JUST 
RIGHT
JUST 
RIGHT
WHY IONIC 
Ionic Builds on Existing Technologies You Love 
• Great JavaScript framework 
• Industry-standard webview 
• Cordova plugins 
• Best layout engine ever created 
• Slick UI components 
• Robust developer community
WHY IONIC 
Ionic Builds on Existing Technologies You Love 
• Great JavaScript framework 
• Industry-standard webview 
• Cordova plugins 
• Best layout engine ever created 
• Slick UI components 
• Robust developer community
THE IONIC TECHNOLOGY STACK
THE IONIC TECHNOLOGY STACK 
ngCordova
BUILT ON ANGULAR.JS 
Use Familiar Tools to Construct Out Your Application
BUILT ON ANGULAR.JS 
Use Familiar Tools to Construct Out Your Application 
Providers 
angular.service() 
angular.factory() 
angular.provider() 
Directives 
angular.directive() 
Controllers 
angular.controller() 
Templates 
<html></html>
STATES MANAGED BY uiROUTER 
State-Based Router with Nested Views 
angular.module('ionicApp', ['ionic']) 
! 
.config(function ($stateProvider, $urlRouterProvider) { 
! 
$stateProvider 
.state('menu', { 
abstract: 'true', 
templateUrl: 'templates/menu.html', 
controller: 'MenuCtrl' 
}) 
! 
/* ... */ 
! 
.state('menu.work', { 
url: '/work', 
views: { 
menuContent: { 
templateUrl: 'templates/work.html', 
controller: 'WorkCtrl' 
} 
} 
}); 
! 
$urlRouterProvider.otherwise('/work'); 
! 
});
STATES MANAGED BY uiROUTER 
State-Based Router with Nested Views 
angular.module('ionicApp', ['ionic']) 
! 
.config(function ($stateProvider, $urlRouterProvider) { 
! 
$stateProvider 
.state('menu', { 
abstract: 'true', 
templateUrl: 'templates/menu.html', 
controller: 'MenuCtrl' 
}) 
! 
/* ... */ 
! 
.state('menu.work', { 
url: '/work', 
views: { 
menuContent: { 
templateUrl: 'templates/work.html', 
controller: 'WorkCtrl' 
} 
} 
}); 
! 
$urlRouterProvider.otherwise('/work'); 
! 
});
COMPONENTS BY IONIC 
Mobile-Appropriate Components and Events, Packaged as Angular Directives
COMPONENTS BY IONIC 
Mobile-Appropriate Components and Events, Packaged as Angular Directives 
UI Components 
Action Sheets 
Alerts 
Buttons 
Cards 
Carousels 
Checkboxes 
Footers 
Forms 
Headers 
Icons 
Lists 
Modals 
Navigations 
Radio Buttons 
Ranges 
Selects 
Tabs 
Toggles 
Events 
on-hold 
on-tap 
on-touch 
on-release 
on-drag 
on-drag-up 
on-drag-right 
on-drag-down 
on-drag-left 
on-swipe 
on-swipe-up 
on-swipe-right 
on-swipe-down 
on-swipe-left
YOUR OWN COMPONENTS 
Familiar Angular.js Syntax (No Additional Learning Curve)
YOUR OWN COMPONENTS 
Familiar Angular.js Syntax (No Additional Learning Curve) 
angular.module('ionicApp').directive(function() { 
! 
! 
! 
! 
! 
! 
! 
});
YOUR OWN COMPONENTS 
Familiar Angular.js Syntax (No Additional Learning Curve) 
angular.module('ionicApp').directive(function() { 
! 
return { 
! 
! 
! 
! 
! 
! 
}); 
template: '<div>...</div>', 
scope: { /* ... */ }, 
restrict: 'E', 
link: function(scope, element) { /* ... */ } 
};
ACCESS THE DEVICE WITH ngCORDOVA 
ngCordova Provides Angular Services for Cordova Plugins
ACCESS THE DEVICE WITH ngCORDOVA 
ngCordova Provides Angular Services for Cordova Plugins 
AdMob 
App Availability 
BackgroundGeolocation 
Battery Status 
Barcode Scanner 
Camera 
Capture 
Clipboard 
Contacts 
DatePicker 
Device 
Device Motion 
Device Orientation 
Dialogs 
File 
Flashlight 
Geolocation 
Globalization 
GoogleAnalytics 
Keyboard 
Keychain 
NativeAudio 
Media 
Local Notification 
Network 
Pin Dialog 
Printer 
Progress Indicator 
Push Notifications 
Social Sharing 
Spinner Dialog 
Splashscreen 
SQLite 
Statusbar 
Toast 
Vibration 
Zip
GETTING STARTED 
Install Global Dependencies 
$
GETTING STARTED 
Install Global Dependencies 
$ npm install -g cordova ionic
GETTING STARTED 
Install Global Dependencies 
$
GETTING STARTED 
Generate a New Application with a Starter Template 
$
GETTING STARTED 
Generate a New Application with a Starter Template 
$ ionic start myApp sidemenu
GETTING STARTED 
Generate a New Application with a Starter Template 
$ ionic start myApp sidemenu
GETTING STARTED 
Generate a New Application with a Starter Template 
$
GETTING STARTED 
Fire It Up 
$
GETTING STARTED 
Fire It Up 
$ cd myApp; ionic serve
GETTING STARTED 
Fire It Up 
$
THE RESULT 
View Our Skeleton Application with Chrome Canary
THE RESULT 
View Our Skeleton Application with Chrome Canary
SCROLLING 
Responds to Drag Events; Eases and Bounces 
<ion-content> 
</ion-content>
SCROLLING 
Responds to Drag Events; Eases and Bounces 
<ion-content> 
</ion-content>
SCROLLING 
Responds to Drag Events; Eases and Bounces 
<ion-content> 
</ion-content> 
has-bouncing="true">
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
Resources 
</ion-item> 
</ion-list>
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
<a class="item item-icon-left item-icon-right" href="#"> 
<i class="icon ion-chatbubble-working"></i> 
Call Ma 
<i class="icon ion-ios7-telephone-outline"></i> 
</a> 
Resources 
</ion-item> 
</ion-list> 
ICONS
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
ICONS <a class="item left" href="#"> 
item-icon-left item-icon-right" href="#"> 
<i class="icon ion-person-stalker"></i> 
Friends 
<span class="badge badge-assertive">0</span> 
</a> 
Resources 
</ion-item> 
</ion-list> 
chatbubble-working"></i> 
Call Ma 
i class="icon ion-ios7-telephone-outline"></i> 
BADGES
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
ICONS <a class="item left" href="#"> 
item-icon-left item-icon-right" href="#"> 
<i class="icon ion-person-stalker"></i> 
Friends 
<span class="badge badge-assertive">0</span> 
</a> 
Resources 
</ion-item> 
</ion-list> 
chatbubble-working"></i> 
Call Ma 
i class="icon ion-ios7-telephone-outline"></i> 
NBOATDEGSES mic-a"></i> 
Record album 
item-note"> 
Grammy 
</span> 
</a>
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
BUTTONS div class="item item-button-right"> 
ICONS <a class="item left" href="#"> 
item-icon-left item-icon-right" href="#"> 
<i class="icon ion-person-stalker"></i> 
Friends 
<span class="badge badge-assertive">0</span> 
</a> 
Call Ma 
<button class="button button-positive"> 
<i class="icon ion-ios7-telephone"></i> 
</button> 
</div> 
Resources 
</ion-item> 
</ion-list> 
chatbubble-working"></i> 
Call Ma 
i class="icon ion-ios7-telephone-outline"></i> 
NBOATDEGSES mic-a"></i> 
Record album 
item-note"> 
Grammy 
</span> 
</a>
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
BUTTONS div class="item item-button-right"> 
ICONS <a class="item left" href="#"> 
item-icon-left item-icon-right" href="#"> 
<i class="icon ion-person-stalker"></i> 
Friends 
<span class="badge badge-assertive">0</span> 
</a> 
Call Ma 
<button class="button button-positive"> 
<i class="icon ion-ios7-telephone"></i> 
</button> 
</div> 
Resources 
</ion-item> 
</ion-list> 
chatbubble-working"></i> 
Call Ma 
i class="icon ion-ios7-telephone-outline"></i> 
NBOATDEGSES mic-a"></i> 
Record album 
item-note"> 
Grammy 
</span> 
</a> 
avatar" href="#"> 
img src="venkman.jpg"> 
h2>Venkman</h2> 
p>Back off, man. I'm a scientist.</p> 
AVATARS
LISTS 
Lists Can Include Dividers, Icons, Badges, Images, and Form Elements 
<ion-list> 
<ion-item 
nav-clear 
class="item-icon-left" 
menu-close 
ui-sref="^.menu.home"> 
! 
<i class="icon ion-home"></i>Home 
</ion-item> 
! 
<!--...--> 
! 
<ion-item class="item-divider"> 
AVATARS BUTTONS div class="item item-item-thumbnail-button-right"> 
left" href="#"> 
ICONS <a class="item left" href="#"> 
icon-left item-icon-right" href="#"> 
chatbubble-working"></i> 
<img src="cover.jpg"> 
<h2>Nirvana</h2> 
p>Nevermind</p> 
i class="icon ion-person-stalker"></i> 
Friends 
<span class="badge badge-assertive">0</span> 
</a> 
Call Ma 
button class="button button-positive"> 
<i class="icon ion-ios7-telephone"></i> 
</button> 
</div> 
Call Ma 
i class="icon ion-ios7-telephone-outline"></i> 
Resources 
</ion-item> 
</ion-list> 
NBOATDEGSES mic-a"></i> 
Record album 
item-note"> 
Grammy 
</span> 
</a> 
avatar" href="#"> 
venkman.jpg"> 
Venkman</Back off, man. I'm a scientist.</p> 
THUMBNAILS
REMEMBER, IT’S JUST ANGULAR 
Combine Lists with Template Placeholders and ngRepeat 
<ion-list ng-controller="ListController"> 
<ion-item ng-repeat="item in items"> 
<i class="icon ion-{{item.icon}}"></i>{{item.title}} 
</ion-item> 
</ion-list> 
!! 
angular.module("IonicApp") 
.controller("ListController", function ($scope) { 
$scope.items = [ 
{icon: "home", title: "Home"}, 
{icon: "envelope", title: "My Messages"}, 
]; 
});
REMEMBER, IT’S JUST ANGULAR 
Combine Lists with Template Placeholders and ngRepeat 
<ion-list ng-controller="ListController"> 
<ion-item ng-repeat="item in items"> 
<i class="icon ion-{{item.icon}}"></i>{{item.title}} 
</ion-item> 
</ion-list> 
!! 
angular.module("IonicApp") 
.controller("ListController", function ($scope) { 
$scope.items = [ 
{icon: "home", title: "Home"}, 
{icon: "envelope", title: "My Messages"}, 
]; 
});
INTELLIGENT NAVIGATION 
Ionic Can Use uiRouter to Keep Track of History and Expose a Back Button to Users 
<ion-nav-bar></ion-nav-bar> 
<ion-nav-view 
animation="slide-left-right"> 
! 
<!-- ... -—> 
! 
</ion-nav-view>
INTELLIGENT NAVIGATION 
Ionic Can Use uiRouter to Keep Track of History and Expose a Back Button to Users 
<ion-nav-bar></ion-nav-bar> 
<ion-nav-view 
animation="slide-left-right"> 
! 
<!-- ... -—> 
! 
</ion-nav-view>
TOUCH GESTURES 
Ionic Uses Hammer.js for Touch Gesture Support 
SIMPLE EXAMPLE 
<div on-swipe="onSwipe()"> 
Test 
</div>
TOUCH GESTURES 
Ionic Uses Hammer.js for Touch Gesture Support 
SIMPLE EXAMPLE 
<div on-swipe="onSwipe()"> 
Test 
</div>
TOUCH GESTURES 
Ionic Uses Hammer.js for Touch Gesture Support 
SIMPLE EXAMPLE 
<div on-swipe="onSwipe()"> 
Test 
</div> 
CARD SWIPE EXAMPLE 
<swipe-cards> 
<swipe-card 
ng-repeat="card in cards" 
on-destroy="cardDestroyed($index)" 
on-card-swipe="cardSwiped($index)"> 
Card content here 
</swipe-card> 
</swipe-cards> 
https://github.com/driftyco/ionic-contrib-swipe-cards
Q & A

Contenu connexe

Tendances

jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
dmethvin
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 

Tendances (20)

Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
 
Building jQuery Mobile Web Apps
Building jQuery Mobile Web AppsBuilding jQuery Mobile Web Apps
Building jQuery Mobile Web Apps
 
jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performance
 
Adobe & HTML5
Adobe & HTML5Adobe & HTML5
Adobe & HTML5
 
High Performance Web Design
High Performance Web DesignHigh Performance Web Design
High Performance Web Design
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
Ionic bbl le 19 février 2015
Ionic bbl le 19 février 2015Ionic bbl le 19 février 2015
Ionic bbl le 19 février 2015
 
Real World Web Standards
Real World Web StandardsReal World Web Standards
Real World Web Standards
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Ionic CLI Adventures
Ionic CLI AdventuresIonic CLI Adventures
Ionic CLI Adventures
 
Mobile Web Development with HTML5
Mobile Web Development with HTML5Mobile Web Development with HTML5
Mobile Web Development with HTML5
 

En vedette

En vedette (20)

Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic FrameworkHybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
 
Introduction to Ionic framework
Introduction to Ionic frameworkIntroduction to Ionic framework
Introduction to Ionic framework
 
Building Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and IonicBuilding Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and Ionic
 
Creating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic FrameworkCreating an hybrid app in minutes with Ionic Framework
Creating an hybrid app in minutes with Ionic Framework
 
Building mobile app with Ionic Framework
Building mobile app with Ionic FrameworkBuilding mobile app with Ionic Framework
Building mobile app with Ionic Framework
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile Applications
 
Workshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic FrameworkWorkshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic Framework
 
Introduction to the Ionic Framework
Introduction to the Ionic FrameworkIntroduction to the Ionic Framework
Introduction to the Ionic Framework
 
Ionic Framework
Ionic FrameworkIonic Framework
Ionic Framework
 
Phone gap android plugins
Phone gap android pluginsPhone gap android plugins
Phone gap android plugins
 
A GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application TestingA GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application Testing
 
Ionic Hybrid Mobile Application
Ionic Hybrid Mobile ApplicationIonic Hybrid Mobile Application
Ionic Hybrid Mobile Application
 
Ionic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application FrameworkIonic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application Framework
 
Connect the dots and Groom as a Professional
Connect the dots and Groom as a ProfessionalConnect the dots and Groom as a Professional
Connect the dots and Groom as a Professional
 
Ionic Framework
Ionic FrameworkIonic Framework
Ionic Framework
 
Native vs. Hybrid Apps
Native vs. Hybrid AppsNative vs. Hybrid Apps
Native vs. Hybrid Apps
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
 
Ionic2
Ionic2Ionic2
Ionic2
 

Similaire à Building Mobile Applications with Ionic

Develop your first mobile App for iOS and Android
Develop your first mobile App for iOS and AndroidDevelop your first mobile App for iOS and Android
Develop your first mobile App for iOS and Android
ralcocer
 
Develop your first mobile App for iOS and Android
Develop your first mobile App for iOS and AndroidDevelop your first mobile App for iOS and Android
Develop your first mobile App for iOS and Android
Ricardo Alcocer
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome Webapps
Home
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
Philipp Bosch
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
mowd8574
 

Similaire à Building Mobile Applications with Ionic (20)

Workshop 15: Ionic framework
Workshop 15: Ionic frameworkWorkshop 15: Ionic framework
Workshop 15: Ionic framework
 
Ionic으로 모바일앱 만들기 #4
Ionic으로 모바일앱 만들기 #4Ionic으로 모바일앱 만들기 #4
Ionic으로 모바일앱 만들기 #4
 
Creating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsCreating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web Components
 
Develop your first mobile App for iOS and Android
Develop your first mobile App for iOS and AndroidDevelop your first mobile App for iOS and Android
Develop your first mobile App for iOS and Android
 
Develop your first mobile App for iOS and Android
Develop your first mobile App for iOS and AndroidDevelop your first mobile App for iOS and Android
Develop your first mobile App for iOS and Android
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
Ionic by Example
Ionic by ExampleIonic by Example
Ionic by Example
 
jQtouch, Building Awesome Webapps
jQtouch, Building Awesome WebappsjQtouch, Building Awesome Webapps
jQtouch, Building Awesome Webapps
 
Ionic HumanTalks - 11/03/2015
Ionic HumanTalks - 11/03/2015Ionic HumanTalks - 11/03/2015
Ionic HumanTalks - 11/03/2015
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)
 
Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)Building Better Web Apps with Angular.js (SXSW 2014)
Building Better Web Apps with Angular.js (SXSW 2014)
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
 
Web app
Web appWeb app
Web app
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for All
 
Web app
Web appWeb app
Web app
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Ionic tabs template explained
Ionic tabs template explainedIonic tabs template explained
Ionic tabs template explained
 
Make your Backbone Application dance
Make your Backbone Application danceMake your Backbone Application dance
Make your Backbone Application dance
 

Dernier

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 

Dernier (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

Building Mobile Applications with Ionic

  • 1. ionic Building Mobile Apps with Ionic An Introduction By Morris Singer
  • 2. WHO AM I • Senior Software Engineer Cengage Learning • Technical Cofounder & General Counsel UnionConnect • Sencha Touch (Two Years) • Angular.js and Node.js (One Year) • Ruby on Rails (Four Years) • Previously…
  • 3. AGENDA • Put Ionic in context • Make the case for Ionic • Review the Ionic technology stack • Explore some Ionic components • Q & A
  • 4. WHAT’S IN A FRAMEWORK Behind the Design of a Framework Rests a Philosophy about the Roles of Javascript and HTML ionic DOM Manipulation Two-Way Data Binding JavaScript-Centric
  • 7. WHY IONIC Ionic Builds on Existing Technologies You Love • Great JavaScript framework • Industry-standard webview • Cordova plugins • Best layout engine ever created • Slick UI components • Robust developer community
  • 8. WHY IONIC Ionic Builds on Existing Technologies You Love • Great JavaScript framework • Industry-standard webview • Cordova plugins • Best layout engine ever created • Slick UI components • Robust developer community
  • 10. THE IONIC TECHNOLOGY STACK ngCordova
  • 11. BUILT ON ANGULAR.JS Use Familiar Tools to Construct Out Your Application
  • 12. BUILT ON ANGULAR.JS Use Familiar Tools to Construct Out Your Application Providers angular.service() angular.factory() angular.provider() Directives angular.directive() Controllers angular.controller() Templates <html></html>
  • 13. STATES MANAGED BY uiROUTER State-Based Router with Nested Views angular.module('ionicApp', ['ionic']) ! .config(function ($stateProvider, $urlRouterProvider) { ! $stateProvider .state('menu', { abstract: 'true', templateUrl: 'templates/menu.html', controller: 'MenuCtrl' }) ! /* ... */ ! .state('menu.work', { url: '/work', views: { menuContent: { templateUrl: 'templates/work.html', controller: 'WorkCtrl' } } }); ! $urlRouterProvider.otherwise('/work'); ! });
  • 14. STATES MANAGED BY uiROUTER State-Based Router with Nested Views angular.module('ionicApp', ['ionic']) ! .config(function ($stateProvider, $urlRouterProvider) { ! $stateProvider .state('menu', { abstract: 'true', templateUrl: 'templates/menu.html', controller: 'MenuCtrl' }) ! /* ... */ ! .state('menu.work', { url: '/work', views: { menuContent: { templateUrl: 'templates/work.html', controller: 'WorkCtrl' } } }); ! $urlRouterProvider.otherwise('/work'); ! });
  • 15. COMPONENTS BY IONIC Mobile-Appropriate Components and Events, Packaged as Angular Directives
  • 16. COMPONENTS BY IONIC Mobile-Appropriate Components and Events, Packaged as Angular Directives UI Components Action Sheets Alerts Buttons Cards Carousels Checkboxes Footers Forms Headers Icons Lists Modals Navigations Radio Buttons Ranges Selects Tabs Toggles Events on-hold on-tap on-touch on-release on-drag on-drag-up on-drag-right on-drag-down on-drag-left on-swipe on-swipe-up on-swipe-right on-swipe-down on-swipe-left
  • 17. YOUR OWN COMPONENTS Familiar Angular.js Syntax (No Additional Learning Curve)
  • 18. YOUR OWN COMPONENTS Familiar Angular.js Syntax (No Additional Learning Curve) angular.module('ionicApp').directive(function() { ! ! ! ! ! ! ! });
  • 19. YOUR OWN COMPONENTS Familiar Angular.js Syntax (No Additional Learning Curve) angular.module('ionicApp').directive(function() { ! return { ! ! ! ! ! ! }); template: '<div>...</div>', scope: { /* ... */ }, restrict: 'E', link: function(scope, element) { /* ... */ } };
  • 20. ACCESS THE DEVICE WITH ngCORDOVA ngCordova Provides Angular Services for Cordova Plugins
  • 21. ACCESS THE DEVICE WITH ngCORDOVA ngCordova Provides Angular Services for Cordova Plugins AdMob App Availability BackgroundGeolocation Battery Status Barcode Scanner Camera Capture Clipboard Contacts DatePicker Device Device Motion Device Orientation Dialogs File Flashlight Geolocation Globalization GoogleAnalytics Keyboard Keychain NativeAudio Media Local Notification Network Pin Dialog Printer Progress Indicator Push Notifications Social Sharing Spinner Dialog Splashscreen SQLite Statusbar Toast Vibration Zip
  • 22. GETTING STARTED Install Global Dependencies $
  • 23. GETTING STARTED Install Global Dependencies $ npm install -g cordova ionic
  • 24. GETTING STARTED Install Global Dependencies $
  • 25. GETTING STARTED Generate a New Application with a Starter Template $
  • 26. GETTING STARTED Generate a New Application with a Starter Template $ ionic start myApp sidemenu
  • 27. GETTING STARTED Generate a New Application with a Starter Template $ ionic start myApp sidemenu
  • 28. GETTING STARTED Generate a New Application with a Starter Template $
  • 30. GETTING STARTED Fire It Up $ cd myApp; ionic serve
  • 32. THE RESULT View Our Skeleton Application with Chrome Canary
  • 33. THE RESULT View Our Skeleton Application with Chrome Canary
  • 34. SCROLLING Responds to Drag Events; Eases and Bounces <ion-content> </ion-content>
  • 35. SCROLLING Responds to Drag Events; Eases and Bounces <ion-content> </ion-content>
  • 36. SCROLLING Responds to Drag Events; Eases and Bounces <ion-content> </ion-content> has-bouncing="true">
  • 37. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> Resources </ion-item> </ion-list>
  • 38. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> <a class="item item-icon-left item-icon-right" href="#"> <i class="icon ion-chatbubble-working"></i> Call Ma <i class="icon ion-ios7-telephone-outline"></i> </a> Resources </ion-item> </ion-list> ICONS
  • 39. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> ICONS <a class="item left" href="#"> item-icon-left item-icon-right" href="#"> <i class="icon ion-person-stalker"></i> Friends <span class="badge badge-assertive">0</span> </a> Resources </ion-item> </ion-list> chatbubble-working"></i> Call Ma i class="icon ion-ios7-telephone-outline"></i> BADGES
  • 40. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> ICONS <a class="item left" href="#"> item-icon-left item-icon-right" href="#"> <i class="icon ion-person-stalker"></i> Friends <span class="badge badge-assertive">0</span> </a> Resources </ion-item> </ion-list> chatbubble-working"></i> Call Ma i class="icon ion-ios7-telephone-outline"></i> NBOATDEGSES mic-a"></i> Record album item-note"> Grammy </span> </a>
  • 41. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> BUTTONS div class="item item-button-right"> ICONS <a class="item left" href="#"> item-icon-left item-icon-right" href="#"> <i class="icon ion-person-stalker"></i> Friends <span class="badge badge-assertive">0</span> </a> Call Ma <button class="button button-positive"> <i class="icon ion-ios7-telephone"></i> </button> </div> Resources </ion-item> </ion-list> chatbubble-working"></i> Call Ma i class="icon ion-ios7-telephone-outline"></i> NBOATDEGSES mic-a"></i> Record album item-note"> Grammy </span> </a>
  • 42. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> BUTTONS div class="item item-button-right"> ICONS <a class="item left" href="#"> item-icon-left item-icon-right" href="#"> <i class="icon ion-person-stalker"></i> Friends <span class="badge badge-assertive">0</span> </a> Call Ma <button class="button button-positive"> <i class="icon ion-ios7-telephone"></i> </button> </div> Resources </ion-item> </ion-list> chatbubble-working"></i> Call Ma i class="icon ion-ios7-telephone-outline"></i> NBOATDEGSES mic-a"></i> Record album item-note"> Grammy </span> </a> avatar" href="#"> img src="venkman.jpg"> h2>Venkman</h2> p>Back off, man. I'm a scientist.</p> AVATARS
  • 43. LISTS Lists Can Include Dividers, Icons, Badges, Images, and Form Elements <ion-list> <ion-item nav-clear class="item-icon-left" menu-close ui-sref="^.menu.home"> ! <i class="icon ion-home"></i>Home </ion-item> ! <!--...--> ! <ion-item class="item-divider"> AVATARS BUTTONS div class="item item-item-thumbnail-button-right"> left" href="#"> ICONS <a class="item left" href="#"> icon-left item-icon-right" href="#"> chatbubble-working"></i> <img src="cover.jpg"> <h2>Nirvana</h2> p>Nevermind</p> i class="icon ion-person-stalker"></i> Friends <span class="badge badge-assertive">0</span> </a> Call Ma button class="button button-positive"> <i class="icon ion-ios7-telephone"></i> </button> </div> Call Ma i class="icon ion-ios7-telephone-outline"></i> Resources </ion-item> </ion-list> NBOATDEGSES mic-a"></i> Record album item-note"> Grammy </span> </a> avatar" href="#"> venkman.jpg"> Venkman</Back off, man. I'm a scientist.</p> THUMBNAILS
  • 44. REMEMBER, IT’S JUST ANGULAR Combine Lists with Template Placeholders and ngRepeat <ion-list ng-controller="ListController"> <ion-item ng-repeat="item in items"> <i class="icon ion-{{item.icon}}"></i>{{item.title}} </ion-item> </ion-list> !! angular.module("IonicApp") .controller("ListController", function ($scope) { $scope.items = [ {icon: "home", title: "Home"}, {icon: "envelope", title: "My Messages"}, ]; });
  • 45. REMEMBER, IT’S JUST ANGULAR Combine Lists with Template Placeholders and ngRepeat <ion-list ng-controller="ListController"> <ion-item ng-repeat="item in items"> <i class="icon ion-{{item.icon}}"></i>{{item.title}} </ion-item> </ion-list> !! angular.module("IonicApp") .controller("ListController", function ($scope) { $scope.items = [ {icon: "home", title: "Home"}, {icon: "envelope", title: "My Messages"}, ]; });
  • 46. INTELLIGENT NAVIGATION Ionic Can Use uiRouter to Keep Track of History and Expose a Back Button to Users <ion-nav-bar></ion-nav-bar> <ion-nav-view animation="slide-left-right"> ! <!-- ... -—> ! </ion-nav-view>
  • 47. INTELLIGENT NAVIGATION Ionic Can Use uiRouter to Keep Track of History and Expose a Back Button to Users <ion-nav-bar></ion-nav-bar> <ion-nav-view animation="slide-left-right"> ! <!-- ... -—> ! </ion-nav-view>
  • 48. TOUCH GESTURES Ionic Uses Hammer.js for Touch Gesture Support SIMPLE EXAMPLE <div on-swipe="onSwipe()"> Test </div>
  • 49. TOUCH GESTURES Ionic Uses Hammer.js for Touch Gesture Support SIMPLE EXAMPLE <div on-swipe="onSwipe()"> Test </div>
  • 50. TOUCH GESTURES Ionic Uses Hammer.js for Touch Gesture Support SIMPLE EXAMPLE <div on-swipe="onSwipe()"> Test </div> CARD SWIPE EXAMPLE <swipe-cards> <swipe-card ng-repeat="card in cards" on-destroy="cardDestroyed($index)" on-card-swipe="cardSwiped($index)"> Card content here </swipe-card> </swipe-cards> https://github.com/driftyco/ionic-contrib-swipe-cards
  • 51. Q & A