-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·510 lines (367 loc) · 15.2 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularJS</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<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/theme/t-systems.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>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="t-systems-logo">
<img src="css/images/t-systems.png">
</div>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Angular.js</h1>
<h3>HTML enhanced for web apps!</h3>
<br>
<h6>Developer Meeting Hamburg (28.02.2013)</h6>
<p>
<small>Created by <a href="mailto:[email protected]">Andreas Taube</a> / <a href="http://twitter.com/andreast00">@andreast00</a></small>
</p>
</section>
<section>
<section>
<h2>What is Angular.js?</h2>
</section>
<section>
<blockquote>Angular is what the web browser would have been, had it been designed for applications.</blockquote>
<p>Misko Hevery (Creator of AngularJS)</p>
</section>
<section>
<blockquote>Pretty sure that HTML6 is going under the codename @angularjs!</blockquote>
<p>Some tweet at Twitter</p>
</section>
<section>
<h2>Facts</h2>
<ul>
<li>A lightweight (meta) framework which teaches the browser new tricks!</li>
<li>100% JavaScript, 100% client side and compatible with both desktop and mobile browsers.</li>
<li>Multi-Browser Support: <br><strong>Desktop: </strong>Safari, Chrome, Firefox, Opera, IE8, IE9 <br><strong>Mobile: </strong> Android, Chrome Mobile, iOS Safari.</li>
<li>File size < 29KB (compressed)</li>
<li>Tests: ~1600</li>
<a href="http://angularjs.org" target="_blank"><img class="angular-logo" src="css/images/AngularJS-large.png"></a>
</ul>
</section>
</section>
<section>
<h2>Benefits</h2>
<ul>
<li>Makes development of web apps extremely easy and fast.</li>
<li>Clear seperation of application logic, presentation components and service layers.</li>
<li>Extremely test friendly.</li>
<li>Strong reusability by extending HTML with custom DSL.</li>
<li>Rich feature set with very common use cases taken care off.</li>
<li>No angular specifiy API calls required -> easy intergration with 3rd party libraries.</li>
<li>Suitable for single-page and rount-trip apps / integration projects.</li>
<li>Good documentation + strong community support (Google)</li>
</ul>
</section>
<section>
<h2>Features</h2>
<ul>
<li>Dependency Injection</li>
<li>Service Abstraction</li>
<li>Directives</li>
<li>Expressions</li>
<li>Forms (validation)</li>
<li>i18n</li>
<li>Modules</li>
<li>Filters</li>
<li>REST Client</li>
</ul>
</section>
<section>
<h2>Mobile</h2>
<ul>
<li>AngularJS targets mobile web browsers, so yes, it can be used to build mobile/responsive web apps!</li>
<li>1 show case available: </li>
<ul>
<li><a href="http://goodfil.ms">Goodfilms (http://goodfil.ms)</a></li>
</ul>
<li>Angular Lungo Bridge</li>
<ul>
<li><a href="http://lungo.tapquo.com" target="_blank">Lungo Cross Device Framework</a></li>
<li><a href="http://centralway.github.com/lungo-angular-bridge/" target="_blank">Lungo Angular Bridge</a></li>
</ul>
</ul>
</section>
<section>
<h2>Main Concepts</h2>
<ul>
<li>Automatic live binding, HTML is your view!</li>
<li>View / Scope / Controller</li>
<li>Extendable HTML with custom DSL (directives)</li>
</ul>
</section>
<section>
<section><h2>Data Binding</h2></section>
<section>
<h2>Traditional One-Way Data Binding</h2>
<img src="/css/images/One_Way_Data_Binding.png" width="500px">
<p>Usually a static string template gets combined with (model) data, resulting in a new string which is then addd to the DOM.</p>
</section>
<section data-state="blackout">
<h2>Example 1</h2>
<h3><a href="http://localhost:3501/templates/example-1.html" target="_blank">Hello World (BackboneJS)</a></h3>
</section>
<section>
<h2>Two-Way Data Binding</h2>
<img src="/css/images/Two_Way_Data_Binding.png" width="500px">
<p>
Angular compiles directives into a live view combined with a scope model. The result is a continuously updating view which does not need template model re-merging.
</p>
<aside class="notes">
<p><strong>No action from the developer is needed to update the view.</strong></p>
<p>The code can get hold of the elements and register event handlers and know that the reference will not be destroyed by template data merge.</p>
</aside>
</section>
<section data-state="blackout">
<h2>Example 2</h2>
<h3><a href="http://localhost:3501/templates/example-2.html" target="_blank">Hello World (AngularJS)</a></h3>
</section>
<!-- <section>
<h2>Comparison</h2>
<img src="/css/images/concepts-view.png" width="600px">
</section> -->
</section>
<section>
<section><h2>Expressions and Filters</h2></section>
<section>
<h2>Expressions</h2>
<p>Expressions are JavaScript-like code snippets that are usually placed in bindings such as <b>{{ expression }}</b>. They are mostly used in views as HTML markup.</p>
<pre>
<code>
1+2
"text".toUpperCase()
myModel.myProperty
</code>
</pre>
</section>
<section>
<h2>Filters</h2>
<ul>
<li>Used to convert raw data into a user-friendly (readable) format.</li>
<li>Can be chained by pipes like in bash.</li>
<li>May accept arguments.</li>
</ul>
<p>
<pre>
<code>
value | filter1 | filter2
123 | number:2
</code>
</pre>
<ul>
<li>Available filters: <br><code>currency, date, filter, json, limitTo, lowercase, uppercase, number, orderBy</code></li>
</ul>
</section>
<section data-state="blackout">
<h2>Example 3</h2>
<h3><a href="http://localhost:3501/templates/example-3.html" target="_blank">Expressions and Filters</a></h3>
</section>
</section>
<section>
<section><h2>View / Scope / Controller</h2></section>
<section>
<h2>View / Scope / Controller</h2>
<ul>
<li>View: HTML (declarative)</li>
<li>Scope: Glue between view and controller.</li>
<li>Controller: JavaScript (imperative) <br><small>No DOM manipulation, no Angular specific api calls.</small></li>
</ul>
<img src="/css/images/concepts-controller.png" width="700px">
</section>
<section>
<h2>Scope hierarchies</h2>
<ul>
<li>Scopes are arranged in hierarchical structure and mimic the DOM strucutre of the application.</li>
<li>Each Angular application has exactly one root scope, but may have several child scopes.</li>
</ul>
<img src="/css/images/concepts-scope.png" width="800px">
</section>
<section data-state="blackout">
<h2>Example 4</h2>
<h3><a href="http://localhost:3501/templates/example-4.html" target="_blank">View-Scope-Controller</a></h3>
</section>
</section>
<section>
<section><h2>Dependency Injection / Services</h2></section>
<section data-state="blackout">
<h2>Example 5</h2>
<h3><a href="http://localhost:3501/templates/example-5.html" target="_blank">Dependency Injection / Services</a></h3>
</section>
</section>
<section>
<section><h2>Directives</h2></section>
<section>
<h2>Directives</h2>
<ul>
<li>Extend the HTML vocabulary in a declarative way.</li>
<li>Attach behavior to any HTML element or attribute.</li>
<li>Create new HTML elements or attributes with custom behavior (DSL).</li>
</ul>
<pre>
<code>
<span ng-form="exp"></span>
<span class="ng-form: exp;"></span>
<ng-form></ng-form>
<!-- directive: ng-form exp -->
</code>
</pre>
<p>Angular provides a set of pre defined directives which are usefull for building web apps. They all use the <strong>ng</strong>-prefix.</p>
<aside class="notes">
A directive is just a function which executes when the compiler encounters it in the DOM.
</aside>
</section>
<section>
<h2>Build in Directives</h2>
<p><code>a, form, input, input [checkbox], input [email], input [number], input [radio], input [text], input [url], ngApp, ngBind, ngBindHtmlUnsafe, ngBindTemplate, ngChange, ngChecked, ngClass, ngClassEven, ngClassOdd, ngClick, ngCloak, ngController, ngCsp, ngDblclick, ngDisabled, ngForm, ngHide, ngHref, ngInclude, ngInit, ngList, ngModel, ngMousedown, ngMouseenter, ngMouseleave, ngMousemove, ngMouseover, ngMouseup, ngMultiple, ngNonBindable, ngPluralize, ngReadonly, ngRepeat, ngSelected, ngShow, ngSrc, ngStyle, ngSubmit, ngSwitch, ngTransclude, ngView, script, select, textarea</code></p>
</section>
<!-- <section>
<h2>Compiler</h2>
<p>Angular's HTML compiler allows the developer to teach the browser new HTML syntax.</p>
<p>The compiler allows you to attach behavior to any HTML element or attribute and even create new HTML element or attributes with custom behavior. Angular calls these behavior extensions directives.</p>
</section> -->
</section>
<!-- <section>
<section><h2>Bootstrap</h2></section>
<section>
<h3>Automatic initialization:</h3>
<pre>
<code>
<!doctype html>
<html ng-app="optionalModuleName">
<body>
I can add: {{ 1+2 }}.
<script src="angular.js"></script>
</body>
</html>
</code>
</pre>
<div class="fragment roll-in">
<p>Upon DOMContentLoaded event, Angular looks for the ng-app directive and performs the following steps:</p>
<ul>
<li>load the module associated with the directive</li>
<li>create the application injector</li>
<li>compile the DOM segment with ng-app</li>
</ul>
</div>
</section>
<section>
<h3>Manual initialization:</h3>
<pre>
<code>
<!doctype html>
<html xmlns:ng="http://angularjs.org">
<body>
Hello {{'World'}}!
<script src="http://code.angularjs.org/angular.js"></script>
<script>
angular.element(document).ready(function() {
angular.bootstrap(document);
});
</script>
</body>
</html>
</code>
</pre>
</section>
</section> -->
<section>
<h2>Tools and Plugins</h2>
<ul>
<li><a href="http://yeoman.io" target="_blank">Yeoman</a></li>
<li><a href="http://testacular.github.com/0.6.0/index.html" target="_blank">testacular</a></li>
<li><a href="http://ngmodules.org" target="_blank">ngmodules</a></li>
<li><a href="http://mgcrea.github.com/angular-strap/" target="_blank">AngularStrap</a></li>
<li><a href="http://angular-ui.github.com" target="_blank">Angular UI</a></li>
<li><a href="http://angular-ui.github.com/bootstrap/" target="_blank">Angular UI Bootstrap</a></li>
</ul>
</section>
<section>
<h2>Performance</h2>
<ul>
<li>AngularJS apps are generally very, very fast.</li>
<li>Up to 1000 live bindings per page perform usually very well.</li>
<li>If performance is an issue:</li>
<ul>
<li>AngularJS Batarang (Chrome Plugin)</li>
<li>Optimize digist cycles / <code>scope.$watch</code> statements</li>
</ul>
</ul>
</section>
<section>
<section>
<h2>Summary</h2>
</section>
<section>
<h2>Pros</h2>
<ul>
<li>Suitable for small and big apps.</li>
<li>Bidirectional data binding.</li>
<li>Clear seperation of concerncs -> easy testability!</li>
<li>HTML can be extended with custom DSL -> great for reusability!</li>
<li>No dependecy on 3rd party libraries.</li>
<li>Add-on projects i.e. <a href="http://angular-ui.github.com" target="_blank">angular-ui</a>, <a href="http://angular-ui.github.com/bootstrap/" target="_blank">angular-bootstrap-ui</a>, etc...</li>
</ul>
</section>
<section>
<h2>Cons</h2>
<ul>
<li>Many new concepts which are hard to understand (in the fist moment) coming from jQuery like app development.</li>
<li>Learning curve, almost no DOM manipulation needed anymore.</li>
<li>Complex data bindings might cause performance issues (>1000 bindings on one page)</li>
<li>Source minifaction (build).</li>
<li>Almost no mobile (mobile-web-apps, hybrid-apps) show cases available.</li>
</ul>
</section>
</section>
<section>
<h1>THE END</h1>
<h3>Andreas Taube</h3>
</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 || 'default', // 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/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>