Angular js and phonegap unite

54
AngularJS and PhoneGap Unite!

description

Presented live on Nov 7-8, 2013 at FITC's Web Unleashed event in Boston. with Lukas Ruebbelke Native mobile development can be painful! So unless you are a masochist, there is a better way to develop mobile applications. This entire presentation will be dedicated to building a pain-free application using AngularJS and the awesome new features of PhoneGap 3.0. In less than an hour? Yep! Is it going to hurt? Nope!

Transcript of Angular js and phonegap unite

Page 1: Angular js and phonegap unite

AngularJS andPhoneGap Unite!

Page 2: Angular js and phonegap unite

Who am I?

Page 3: Angular js and phonegap unite

Lukas RuebbelkeBlogs at http://onehungrymind.com/

Tweets at @simpulton

Contributed to AngularJS

Co-Author of AngularJS in Action

Page 4: Angular js and phonegap unite

What is the goal?

Page 5: Angular js and phonegap unite

Mobiledevelopment feels

like this.

Page 6: Angular js and phonegap unite

It should feel likethis.

Page 7: Angular js and phonegap unite

Get feedbackfaster

Page 8: Angular js and phonegap unite

Being honest

I AM LAZY!

Page 9: Angular js and phonegap unite

We all want to spend more time

BEING AWESOME!

Page 10: Angular js and phonegap unite

Do you have anapplication?

Page 11: Angular js and phonegap unite

Is it responsive?

Page 12: Angular js and phonegap unite

You are here...

Page 13: Angular js and phonegap unite

And here we are!

Page 14: Angular js and phonegap unite

Part Zero:Foundation

Page 15: Angular js and phonegap unite

History of AngularJSDeveloped in 2009 by Misko Hevery.

Publicly released as version 0.9.0 in October 2010

Currently at version 1.0.8 stable or 1.2.0rc3 unstable

Page 16: Angular js and phonegap unite

The AngularJS Elevator PitchAn intuitive framework that makes it easy to organize your code.

Testable code makes it easier to sleep at night.

Two-way data binding saves you hundreds of lines of code.

Templates that are HTML means you already know how to write them.

Data structures that are just JavaScript make integration really easy.

99 Problems but scope ain’t one of them!

Page 17: Angular js and phonegap unite

Hello AngularJS From Scratch// script.jsangular.module('MyApp', []) .controller('MainCtrl', function($scope) { $scope.world = 'Phoenix!; });

// index.html<html ng-app="MyApp">

<body ng-controller="MainCtrl"> <h1>Hello {{world}}</h1></body>

Page 18: Angular js and phonegap unite

The Big AngularJS Picture

Page 19: Angular js and phonegap unite
Page 20: Angular js and phonegap unite

Model View WhateverChoose “whatever” pattern helps you be more productive

Page 21: Angular js and phonegap unite
Page 22: Angular js and phonegap unite

Controller and $scope$scope is the glue between the Controller and the View

The Controller is responsible for constructing the model on $scope andproviding commands for the View to act upon

$scope provides context

Page 23: Angular js and phonegap unite
Page 24: Angular js and phonegap unite

View and TemplatesThe View is AngularJS compiled DOM

The View is the product of $compile merging the HTML template with $scope

DOM is no longer the single source of truth.

Page 25: Angular js and phonegap unite

Models and ServicesServices carry out common tasks specific to the web application

Services are consumed via Dependency Injection

Services are application singletons

Services are instantiated lazily

Page 26: Angular js and phonegap unite

The 80/20 Rule

Page 27: Angular js and phonegap unite

Part One:AngularJS

Page 28: Angular js and phonegap unite
Page 29: Angular js and phonegap unite
Page 30: Angular js and phonegap unite
Page 31: Angular js and phonegap unite
Page 32: Angular js and phonegap unite
Page 33: Angular js and phonegap unite

Stop! Demo Time!

Page 34: Angular js and phonegap unite

Part Two: Firebase

Page 35: Angular js and phonegap unite
Page 36: Angular js and phonegap unite
Page 37: Angular js and phonegap unite

Stop! Demo Time!

Page 38: Angular js and phonegap unite

Part Three:PhoneGap

Page 39: Angular js and phonegap unite
Page 40: Angular js and phonegap unite
Page 41: Angular js and phonegap unite
Page 42: Angular js and phonegap unite

PhoneGap 3.0Whoa!

$ sudo npm install -g phonegap

$ phonegap create hello com.example.hello HelloWorld

$ cd hello

$ phonegap run ios

Page 43: Angular js and phonegap unite
Page 44: Angular js and phonegap unite

Step OneInstall the SDKs for the platforms

you are targeting

Page 45: Angular js and phonegap unite

Step TwoInstall the CLI$ sudo npm install -g phonegap

Page 46: Angular js and phonegap unite

Step ThreeCreate your project

$ phonegap create leaderboard com.example.leaderboard Leaderboard

$ cd leaderboard

Page 47: Angular js and phonegap unite

Step FourRun your project

$ phonegap run ios

$ phonegap run android

Page 48: Angular js and phonegap unite

Stop! Demo Time!

Page 49: Angular js and phonegap unite

Resources

Page 50: Angular js and phonegap unite

AngularJShttp://angularjs.org/

Year of Moo http://www.yearofmoo.com/

One Hungry Mind http://onehungrymind.com/

Egghead.io http://egghead.io/

Page 51: Angular js and phonegap unite

Firebasehttps://www.firebase.com/

http://angularfire.com/

Page 52: Angular js and phonegap unite

PhoneGaphttp://phonegap.com/

Andrew Trice http://www.tricedesigns.com/

Christophe Coenraets http://coenraets.org/blog/

Holly Schinsky http://devgirl.org/

Page 53: Angular js and phonegap unite

Thanks!

Page 54: Angular js and phonegap unite