Upload
george-stocker
View
118
Download
0
Tags:
Embed Size (px)
Citation preview
Housekeeping…
• Thanks to our host
• Respect your speakers and fellow attendees:Set mobile devices to vibrate or silent
• Fill out session evaluations• They are used in the drawings
• You must be present to win at the wrap-up
HTML5 LocalStorage
var user = {
name: 'George',
url: ‘http://georgestocker.com‘
};
localStorage.setItem(‘user’, JSON.stringify(user));
Adding Data
<!-- config.xml -->
<widget ...>
<preference name="BackupWebStorage" value="none" />
</widget>
source: http://learn.ionicframework.com/formulas/localstorage/
HTML5 LocalStorage
Disadvantages
Sqlite
Advantages
var query = "SELECT * FROM people WHERE id = ?";
$cordovaSQLite.execute(db, query, [id]).then(function(res) {
//do something
});
MBaaS
georgestocker.com/2015/04/03/mbaas-where-are-they-now/
MBaaS
georgestocker.com/2015/04/03/mbaas-where-are-they-now/
TL;DR
It depends
AngularJS
Routing
Controller
$stateProvider.state(‘userDetail’, {
url:”/users/:userId”,
controller:”UserCtrl”,
templateUrl:”templates/userdetails.html”
})
http://myexample.com/#/users/1
AngularJS
Routing
Controller
$state.go(‘user’, {userId: 1});
http://myexample.com/#/users/1
AngularJS
Services
Controller
.controller(‘UserCtrl,
[‘$stateParams’, ‘UserService’,
function($stateParams, UserService) {
var user = UserService.get($stateParams.userId)
}
]);
Ionic
Cross Platform
Directives
<ion-list ng-controller=“MyCtrl”
show-delete=“shouldShowDelete”
show-reorder=“shouldShowReorder”
can-swipe=“listCanSwipe”>
<ion-item ng-repeat="item in items">
Hello, {{item}}!
</ion-item>
</ion-list>
Ionic
Cross Platform
Directives
app.controller('MyCtrl', function($scope) {
$scope.shouldShowDelete = false;
$scope.shouldShowReorder = false;
$scope.listCanSwipe = true
});
http://ionicframework.com/docs/api/directive/ionList/
Ionic
Custom Mobile JavaScript
$ionicLoading.show()
onHold()
onSwipe()
onSwipeLeft()
and more…
http://ionicframework.com/docs/api/