Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OpenWest Ionic Presentation

OpenWest Ionic Presentation

My presentation at OpenWest 2014

Avatar for David Moulton

David Moulton

May 09, 2014
Tweet

More Decks by David Moulton

Other Decks in Programming

Transcript

  1. ABOUT ME I grew up in Cody, Wyoming ! I

    currently live in Orem ! I graduated from this fine institution ! I think this building was grass at that time ! I’m a Ruby/AngularJS developer at EmpowerIT ! When not working, I’m either attached to motorcycle handlebars or a fly fishing rod.
  2. QUESTIONS How many have used Cordova? How many have used

    AngularJS? How many have written a mobile app some other way? What has your experience been?
  3. WHO IS IONIC FOR? I’ve been web programming for ~18

    years. I have rubber to wear off my tires evenings & weekends I’d like to be able to create apps for iPhone and Android I’d like to save my company money and time
  4. ABOUT IONIC ionicframework.com Very new - First Alpha release in

    November 2013 Combines Apache Cordova and AngularJS Lots of Framework-y additions to make life easier Sort of Bootstrap for Cordova, but not really Only works on Android 4.2+ (possibly 4.1+)
  5. ANATOMY OF AN IONIC APP Its really just a Cordova

    app ! ! platforms directory This depends on what platforms you are building for ! scss directory Use this to modify Ionic’s default Look and Feel ! plugins directory http://plugins.cordova.io ! www directory Where the magic happens
  6. WWW DIRECTORY Let’s create a demo app Create an ionic

    app ionic start myApp blank | tabs | sidemenu
  7. RUNNING THE APP • Local Debug • iOS emulator •

    Android emulator python -m SimpleHTTPServer 8000 ! ionic platform add ios | android ! ionic build ios | android ! ionic emulate ios | android
  8. CROSS DOMAIN SCRIPTING Necessary if you are going to do

    server calls ! Changes to client angular.module("moduleName", []).config(function($httpProvider) { delete $httpProvider.defaults.headers.common["X-Requested-With"]; $httpProvider.defaults.useXDomain = true; }) Changes to server (Sinatra) before do headers 'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST'], 'Access-Control-Allow-Headers' => 'Content-Type' end