PhoneGap + AngularJS + Topcoat – Workshop – Cordova/PhoneGap



PhoneGap + AngularJS + Topcoat – Workshop – Cordova/PhoneGap

1 0


phonegap_meetup

Phonegap Meetup Slide @ Geekdom, SF

On Github kruyvanna / phonegap_meetup

PhoneGap + AngularJS + Topcoat

Workshop

Kruy Vanna / @kruyvanna

Cordova/PhoneGap

Cordova/PhoneGap

  • Bringing native features to the JS world
  • Cross platform (recently: +Chrome App)

AngularJS

HTML enhanced for App

Trends

Some features of AngularJS in action

Data Binding

							<input type="text" ng-model="name">
<div>
	Hello {{name}}
</div>
						

Hello

Controller

							function Controller1( $scope ){
	$scope.name = "1";
}

function Controller2( $scope ){
	$scope.name = "2";
}
						
							<div ng-controller="Controller1">
	<h2>{{name}}</h2> // "1"
</div>

<div ng-controller="Controller2">
	<h2>{{name}}</h2> // "2"
</div>
						

Form Validation

							<form name="myForm">
	<input type="text" name="name" required="required">
	<span ng-show="myForm.name.$error.required">Name is required</span>
</form>
						

Name is required

Other features

  • Directives
  • Filters
  • Dependency Injection
  • Localization

Topcoat

Goal

  • Mobile First
  • Performance matters
  • 0% JS

Components

Now workshop time!

What we will create

A Todo App

Tool we will use

Monaca

Let's start with this Template

https://github.com/kruyvanna/todo

The complete source code

https://github.com/kruyvanna/Todo_Complete

Other factors to make your App successful

  • fastclick
  • -webkit-tap-highlight-color: rgba(0,0,0,0);
  • -webkit-user-select: none;
  • -webkit-overflow-scrolling: touch;
  • Page management

Onsen UI

Wrapup

  • PhoneGap
  • AngularJS
  • Topcoat

THE END