forked from adamdbradley/ionic-present
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·761 lines (627 loc) · 23.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Presentation created using reveal.js: https://github.com/hakimel/reveal.js -->
<!-- Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se -->
<title>Building Hybrid Apps with AngularJS and Ionic</title>
<meta name="description" content="Ionic Framework Presentation: The beautiful, open source framework for developing hybrid mobile apps with HTML5.">
<meta name="author" content="https://twitter.com/adamdbradley">
<meta name="author" content="https://twitter.com/benjsperry">
<link rel="shortcut icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/ionic.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<img src="img/ionic-logo.png" class="logo" width="296" height="331">
<h4>Building Hybrid Apps with AngularJS and Ionic</h4>
</section>
<section>
<img src="img/me.jpeg" style="position: absolute; top:0; left:0; max-width: 260px; max-height: 260px; border-radius: 30px">
<ul style="position: absolute; top:0; left:300px;">
<li>Adam Bradley</li>
<li>Co-Creator of Ionic Framework</li>
<li>Angular Material Design Team Member</li>
<li>Drifty Co, Madison, Wisconsin</li>
<li><a href="https://twitter.com/adamdbradley">@adamdbradley</a></li>
<li><a href="https://github.com/adamdbradley">github.com/adamdbradley</a></li>
</ul>
</section>
<section>
<h2>Overview</h2>
<ol>
<li>Native vs Hybrid Apps</li>
<li>Intro Ionic</li>
<li>UI Components</li>
<li>Ionic CLI</li>
<li>Demos</li>
</ol>
</section>
<section>
<blockquote>
“I want a native app!”
</blockquote>
</section>
<section>
<h2>The Downsides of Native</h2>
<ul>
<li>Proficiency in each platform required</li>
<li>Entirely separate code bases</li>
<li>Timely & expensive development</li>
<li>Diminishing returns</li>
</ul>
</section>
<section>
<h3>More Platforms. More Problems.</h3>
<p style="margin-top: 60px">
<img src="img/apple.png" class="logo" width="200" height="200" style="margin-right: 10px">
<img src="img/android.png" class="logo" width="200" height="200" style="margin-left: 10px; margin-right: 10px">
<img src="img/windows.png" class="logo" width="200" height="200" style="margin-left: 10px; margin-right: 10px">
<img src="img/firefoxos.png" class="logo" width="200" height="200" style="margin-left: 10px;">
</p>
<p><span class="light-text">
Why are we still coding for multiple platforms?
</span></p>
</section>
<section>
<blockquote>
“Is there an alternative?”
</blockquote>
</section>
<section>
<img src="img/cordova.png" class="logo" style="margin-bottom: 0;">
<ul>
<li>Hybrid Apps: HTML5 that acts like native</li>
<li>Phonegap renamed to Cordova</li>
<li>Web wrapped in native layer</li>
<li>Direct access to native APIs</li>
<li>Familiar web dev environment</li>
<li>Develop a single code base (web platform)</li>
</ul>
</section>
<section>
<blockquote>
“Oh No! The Zuck has spoken!”
</blockquote>
<img src="img/tech-crunch.png">
<p style="font-size:10px">
http://techcrunch.com/2012/09/11/mark-zuckerberg-our-biggest-mistake-with-mobile-was-betting-too-much-on-html5/
</p>
</section>
<section style="background:url(img/fb.png) no-repeat; background-size: 200px 200px;">
<h2 style="margin-left: 150px;">Are You Building the Facebook app?</h2>
<ul>
<li>Have a multi-million dollar budget?</li>
<li>Have a large team of experienced native developers?</li>
<li>Does your billion-dollar revenue depend on this app?</li>
<li>If so...do native</li>
<li class="fragment">...but today it's not so black and white</liv>
</ul>
</section>
<section>
<blockquote>
“Hybrid apps are slow!”
</blockquote>
<blockquote class="fragment">
“The Times They Are a-Changin'”
</blockquote>
</section>
<section>
<h3>Mobile devices have rapidly improved!</h3>
<table>
<tr>
<th>Year</th>
<th>Device</th>
<th>Processor</th>
<th>RAM</th>
</tr>
<tr>
<td>2007</td>
<td>iPhone</td>
<td>620 MHz</td>
<td>128 MB</td>
</tr>
<tr>
<td>2010</td>
<td>iPhone 4</td>
<td>1 GHz</td>
<td>512 MB</td>
</tr>
<tr>
<td>2014</td>
<td>iPhone 5S</td>
<td>1.3 GHz dual-core</td>
<td>1 GB</td>
</tr>
</table>
</section>
<section>
<h3>Web-standards have rapidly improved!</h3>
<ul style="float:left; width: 75%;">
<li>caniuse.com is lookin' pretty good nowadays</li>
<li>Android is now Chromium-based</li>
<li>iOS users keep their devices up-to-date</li>
</ul>
<img src="img/caniuse.png" width=200 class="logo">
</section>
<section>
<img src="img/ios7-adoption.png">
<p style="font-size:10px">https://mixpanel.com/trends/#report/ios_7/from_date:-332,to_date:0</p>
</section>
<section>
<img src="img/android-adoption.png">
<p style="font-size:10px">https://mixpanel.com/trends/#report/android_kitkat</p>
</section>
<section>
<h2>Native SDKs Are Great</h2>
<ul>
<li>Common UI</li>
<li>Views</li>
<li>Navigation and stack history</li>
<li>Transitions</li>
<li>Gestures</li>
</ul>
</section>
<section>
<h2>There's No Web SDK</h2>
<ul>
<li>It's the wild-west for hybrid apps</li>
<li>We need to bridge the gap between web and native</li>
<li>We need rich, native-style UI components and interactions</li>
<li>We need UI APIs, not just jQuery widgets</li>
</ul>
</section>
<section>
<img src="img/ionic-logo.png" class="logo" width="296" height="331">
<blockquote>
“Hello.”
</blockquote>
</section>
<section>
<h2>Web Technologies You Already Know and Love</h2>
<div style="margin-top: 70px">
<img src="img/html.png" class="logo" width="185" height="260">
<img src="img/css.png" class="logo" width="185" height="260" style="margin-left: 80px; margin-right: 80px;">
<img src="img/js.png" class="logo" width="185" height="260">
</div>
<p style="margin-top: 30px"><span class="light-text">
(You'll feel right at home)
</span></p>
</section>
<section>
<img src="img/trends.png">
<p style="font-size:10px">http://www.google.com/trends/explore#q=angularjs%2C%20ember.js%2C%20knockoutjs%2C%20backbonejs&date=8%2F2011%2037m&cmpt=q</p>
</section>
<section>
<img src="img/angular-icon.png" class="logo" width="210" height="210" style="margin-bottom: 0px">
<h3>Standing on the Shoulders of AngularJS</h3>
<ul>
<li>Proven for large-scale webapp development</li>
<li>Extends the HTML vocabulary</li>
<li>UI Components using Directives and Services</li>
</ul>
</section>
<section>
<img src="img/native-icon.png" class="logo" width="210" height="210" style="margin-bottom: 0px">
<h2>Native Focused</h2>
<ul>
<li>Modeled off of native SDKs</li>
<li>Built to work with Cordova</li>
</ul>
</section>
<section>
<img src="img/performance-icon.png" class="logo" width="210" height="210" style="margin-bottom: 0px">
<h2>Performance Obsessed</h2>
<ul>
<li>Hardware accelerated animations</li>
<li>Minimal DOM Manipulation</li>
<li>Remove 300ms tap delay</li>
</ul>
</section>
<section>
<img src="img/design-icon.png" class="logo" width="210" height="210" style="margin-bottom: 0px">
<h2>Plain ol' CSS</h2>
<ul>
<li>Cohesive visual system</li>
<li>Clean and simple</li>
<li>Easy to customize</li>
<li>Stand-alone CSS (independent of Ionic's JavaScript)</li>
<li><a href="http://ionicframework.com/docs/components/" target="_blank">ionicframework.com/docs/components</a></li>
</ul>
</section>
<section>
<p>
<img src="img/sass-icon.png" class="logo" width="210" height="210" style="margin-bottom: 0px">
</p>
<ul>
<li>CSS generated from the Sass preprocessor</li>
<li>Quickly give your app its own look and feel</li>
<li>CSS designed to be easily overridden</li>
<li>Variables based with default settings</li>
<li>80+ reusable and useful mixins</li>
</ul>
</section>
<section>
<h2>Ionicons</h2>
<img src="img/ionicons.png" class="logo" width="655" height="436">
<p>Over 600 MIT licensed font-icons included</p>
<p><a href="http://ionicons.com/" target="_blank">ionicons.com</a></p>
</section>
<section>
<blockquote>
“How does it all come together?”
</blockquote>
<div class="stack">Your App</div>
<div class="stack">Ionic</div>
<div class="stack">AngularJS</div>
<div class="stack">WebView (Cordova)</div>
<div class="stack">Native SDK</div>
</section>
<section>
<h2>Ionic's Adoption</h2>
<ul>
<li>8400+ Github Stars</li>
<li>Top 80 mosted starred Github repos</li>
<li>Consistently Top 10 trending JS Github repos</li>
<li>Ionic CLI averages 1,000 downloads/day</li>
<li>120,000+ Ionic apps have been started from our CLI</li>
<li>Released Alpha: November 2013</li>
<li>Released Beta: March 2014</li>
<li>Release Candidate: Fall 2014</li>
</ul>
</section>
<section>
<blockquote>
UI Component Overview
</blockquote>
</section>
<section>
<div class="col preview">
<img src="img/list-example.png" class="logo" width="380" height="800">
</div>
<div class="col code">
<h2>Lists</h2>
<pre><code data-trim contenteditable class="xml">
<div class="list">
<div class="item item-divider">
Candy Bars
</div>
<a class="item" href="#">
Butterfinger
</a>
<a class="item" href="#">
Kit Kat
</a>
...
</div></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/list/index.html"></iframe>
</div>
<div class="col code">
<h2>Complex Lists</h2>
<ul style="margin-left: 70px">
<li>AngularJS Directive</li>
<li>Buttons exposed by swiping</li>
<li>Reorder</li>
<li>Delete</li>
</ul>
<pre><code data-trim contenteditable class="xml">
<ion-list>
<ion-item ng-repeat="item in items"
item="item">
List Item {{ item.id }}
</ion-item>
</ion-list></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/collection-repeat/index.html"></iframe>
</div>
<div class="col code">
<h2>Collection Repeat</h2>
<ul style="margin-left: 70px">
<li>Similar to Angular's <code>ng-repeat</code></li>
<li>Inspired by iOS’s UICollectionView</li>
<li>Scroll through thousands of items</li>
<li>Only renders the viewable items</li>
<li>Smooth jank-free scrolling</li>
</ul>
<pre><code data-trim contenteditable class="xml">
<div class="list">
<div collection-repeat="c in contacts">
<h2>{{ c.name }}</h2>
<p>{{ c.email }}</p>
</div>
</div></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/navigation/index.html"></iframe>
</div>
<div class="col code">
<h2>Navigation</h2>
<ul style="margin-left: 70px">
<li>Uses AngularUI Router</li>
<li>Shows back button when possible</li>
<li>Transitions follow direction of nav</li>
<li>Works with Android's back button</li>
</ul>
<pre><code data-trim contenteditable class="xml">
<ion-nav-bar>
<ion-nav-back-button>
Back
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/tabs/index.html"></iframe>
</div>
<div class="col code">
<h2>Tabs</h2>
<ul style="margin-left: 70px">
<li>Nested views</li>
<li>Each tab has its own nav history</li>
<li>Abstract states in AngularUI Router</li>
</ul>
<pre><code data-trim contenteditable class="xml">
<ion-tabs>
<ion-tab title="Home" icon="ion-home">
<ion-nav-view name="home"></ion-nav-view>
</ion-tab>
<ion-tab title="About" icon="ion-information">
<ion-nav-view name="about"></ion-nav-view>
</ion-tab>
<ion-tab title="Contact" icon="ion-ios7-world">
<ion-nav-view name="contact"></ion-nav-view>
</ion-tab>
</ion-tabs></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/sidemenu/index.html"></iframe>
</div>
<div class="col code">
<h2>Side Menu</h2>
<pre><code data-trim contenteditable class="xml">
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-assertive">
<h1 class="title">Left Menu</h1>
</ion-header-bar>
<ion-content>
...
</ion-content>
</ion-side-menu>
</ion-side-menus>
</code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/slidebox/index.html"></iframe>
</div>
<div class="col code">
<h2>Slide Box</h2>
<pre><code data-trim contenteditable class="xml">
<ion-slide-box on-slide-changed="change(index)">
<ion-slide>
Slide 1
</ion-slide>
<ion-slide>
Slide 2
</ion-slide>
<ion-slide>
Slide 3
</ion-slide>
</ion-slide-box></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/actionsheet/index.html"></iframe>
</div>
<div class="col code">
<h2>Action Sheet</h2>
<ul style="margin-left: 70px">
<li>AngularJS Service</li>
<li>Inject into controllers</li>
</ul>
<pre><code data-trim contenteditable class="js">
$ionicActionSheet.show({
titleText: 'Action Sheet Example',
buttons: [
{ text: 'Share' },
{ text: 'Move' },
],
destructiveText: 'Delete',
cancelText: 'Cancel',
buttonClicked: function(index) {
console.log('BUTTON CLICKED', index);
return true;
}
});</code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/popover/index.html"></iframe>
</div>
<div class="col code">
<h2>Popover</h2>
<ul style="margin-left: 70px">
<li>AngularJS Service</li>
<li>Inline or external template</li>
</ul>
<pre><code data-trim contenteditable class="js">
$ionicPopover.fromTemplateUrl('popover.html',
function(popover) {
$scope.popover = popover;
}
);</code></pre>
<pre><code data-trim contenteditable class="xml">
<ion-popover-view>
<ion-header-bar>
<h1 class="title">My Popover Title</h1>
</ion-header-bar>
<ion-content class="padding">
Hello!
</ion-content>
</ion-popover-view></code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/modal/index.html"></iframe>
</div>
<div class="col code">
<h2>Modal</h2>
<ul style="margin-left: 70px">
<li>AngularJS Service</li>
<li>Inline or external template</li>
</ul>
<pre><code data-trim contenteditable class="js">
$ionicModal.fromTemplateUrl('modal.html', {
scope: $scope
}).then(function(modal) {
$scope.modal = modal;
});</code></pre>
</div>
</section>
<section>
<div class="col preview demo-frame">
<iframe src="demos/pull-to-refresh/index.html"></iframe>
</div>
<div class="col code">
<h2>Pull to Refresh</h2>
<pre><code data-trim contenteditable class="xml">
<ion-refresher on-refresh="doRefresh()"
pulling-text="Pull to refresh..."
refreshing-text="Refreshing!"
refreshing-icon="ion-loading-c">
</ion-refresher></code></pre>
</div>
</section>
<section>
<pre class="ionic-blue"><code>
$ npm install -g ionic
_ _
(_) (_)
_ ___ _ __ _ ___
| |/ _ \| '_ \| |/ __|
| | (_) | | | | | (__
|_|\___/|_| |_|_|\___| CLI
</code></pre>
<ul>
<li>Quickly create a project with starter templates</li>
<li>Boilerplate app structure ready for customization</li>
<li>Preconfigured tools: Gulp, Sass, Bower, etc.</li>
<li>Start a local dev server with LiveReload</li>
<li>Update Ionic Framework library files</li>
<li>Build and run native apps</li>
</ul>
</section>
<section>
<h2>Ionic CLI</h2>
<pre class="ionic-blue">
<code class="fragment">$ npm install -g ionic cordova</code>
<code class="fragment">$ ionic start myapp sidemenu</code>
<code class="fragment">$ cd myapp</code>
<code class="fragment">$ ionic serve</code>
</pre>
</section>
<section>
<h2><strong>Demo Time!</strong></h2>
<h6 class="light-text">May the demo gods be with us</h6>
</section>
<section>
<h2><span style="text-decoration:line-through">Ionic</span> Angular Testing</h2>
<ul>
<li>It's just an AngularJS app!</li>
<li>Setup with a great separation of concerns</li>
<li>Karma unit tests</li>
<li>Protractor e2e tests</li>
</ul>
</section>
<section>
<h2>Ionic Showcase</h2>
<img src="img/showcase.png" height="300">
<p>
<a href="http://showcase.ionicframework.com/" target="_blank">showcase.ionicframework.com</a>
</p>
</section>
<section>
<h2><strong>MIT LICENSED</strong></h2>
<h6 class="light-text">Free to use (even commercially)</h6>
</section>
<section>
<h2><strong>COMMUNITY POWERED</strong></h2>
<h6 class="light-text">Active developer forum, IRC and GitHub repo</h6>
</section>
<section>
<h2>Get Started with Ionic!</h2>
<br />
<p><strong>Easy-to-follow videos, tutorials and formulas</strong><br />
<a href="http://learn.ionicframework.com/" target="_blank"><span class="light-text">learn.ionicframework.com</span></a></p>
<br />
<p><strong>Visit the Community Forum</strong><br />
<a href="http://forum.ionicframework.com/" target="_blank"><span class="light-text">forum.ionicframework.com</span></a></p>
<br />
<p><strong>Contribute on GitHub</strong><br />
<a href="https://github.com/driftyco/ionic" target="_blank"><span class="light-text">github.com/driftyco/ionic</span></a></p>
</section>
<section>
<h2><code style="font-size:60px"></html></code></h2>
<h3><a href="https://twitter.com/adamdbradley" target="_blank">@adamdbradley</a></h3>
<h4><a href="http://adamdbradley.github.io/ionic-present/#/">http://adamdbradley.github.io/ionic-present</a></h4>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'fade', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
if(location.protocol == 'file:') {
alert('This presentation must be hosted be a web server for the demos to work, such as python -m SimpleHTTPServer')
}
</script>
</body>
</html>