-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
757 lines (665 loc) · 28.9 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to AngularJS ~ Girl Develop It</title>
<meta name="description" content="Girl Develop It Intro to Angular Class. Alexandra Hoefinger (@ahoef) developed and taught this workshop for GDI Philly">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor --><link rel="stylesheet" href="lib/css/light.css">
<!-- dark editor <link rel="stylesheet" href="lib/css/dark.css">-->
<!-- <link rel="stylesheet" href="lib/css/zenburn.css"> -->
<link rel="stylesheet" href="plugin/accessibility-helper/css/accessibility-helper.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening -->
<section>
<img src="img/circle-gdi-logo.png" alt="GDI Logo" class="noborder"/>
<h1>Intro to AngularJS</h1>
</section>
<!-- Welcome-->
<section class="hide-pdf">
<h3>Welcome!</h3>
<div class = "left-align">
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
<p class ="green">Some "rules"</p>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</div>
</section>
<section>
<h3>Agenda — Day 1</h3>
<!-- <p>This class will be a combo of lecture + exercises. It is 4 hours long, split over 2 days</p> -->
<ul>
<li>Introductions</li>
<li>Overview of MVC patterns</li>
<li>Overview of a basic Angular app</li>
<li>Built-in Directives and Expressions</li>
</ul>
</section>
<section>
<h3>Agenda — Day 2</h3>
<ul>
<li>Controllers & $scope</li>
<li>Dependency Injection</li>
<li>Beyond the Basics</li>
<li>Angular 2.0</li>
</ul>
</section>
<section>
<h3>Introductions</h3>
<div class = "left-align">
<p>Tell us about yourself.</p>
<ul>
<li>Who are you?</li>
<li>What do you hope to get out of the class?</li>
<li>Which of your web projects are you most proud of?</li>
</ul>
</div>
</section>
<section>
<h3>What is AngularJS?</h3>
<ul>
<li>A client-side JavaScript framework for extending HTML in small → large apps</li>
<li>Initially released in 2009 by Google</li>
<li>Used in production by Google, Virgin America, HBO, msnbc, Nike, Urban Outfitters, & more</li>
<li>Known for data-binding, directives, dependency injection, & more</li>
<li>Falls within the family of MV* frameworks, and is often compared to Ember.js, Backbone.js, & React</li>
</ul>
</section>
<section>
<h3>What is a MV* framework?</h3>
<ul>
<li>A variation of an MVC (Model View Controller)</li>
<li>Model — a type of data to model, like a user, account, photo, or note</li>
<li>View — the markup & templates for the UI</li>
<li>Controller — handles input & updates state of model</li>
<li>MVC, MVVM, MVVMCS, ...</li>
</ul>
</section>
<section>
<h3>What is a MV* framework?</h3>
<img src="img/500px-MVC-Process.png" alt="Model updates view, user sees view, user uses controller, controller manipulates model">
<p><small>Image Credit: <a href="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/MVC-Process.svg/500px-MVC-Process.svg.png" target="_blank">Wikimedia</a></small></p>
</section>
<section>
<h3>What is a MV* framework?</h3>
<ul>
<li>Main features are some combination of routing, data binding, templates/views, models & data access</li>
<li>Can be client- or server-side, and not specific to JavaScript</li>
</ul>
</section>
<section>
<h3>What type of MV* is Angular?</h3>
<ul>
<li>There's much debate on what exactly Angular is</li>
<li>Angular has evolved since release, and developers implement it differently</li>
<li>Many agree that it is an MVW (Model View Whatever)</li>
</ul>
</section>
<section>
<h3>Why Use Angular?</h3>
<ul>
<li>Easy to get up and running</li>
<li>Code organization</li>
<li>Speedy websites</li>
<li>Unit testing</li>
<li>Many, many resources</li>
</ul>
</section>
<section>
<h3>An example Angular App</h3>
<p>A basic <a href="demo-files/completed-exercises/todo-list/todo-list.html" target="_blank">todo list app</a></p>
<p>The <a href="demo-files/completed-exercises/todo-list/todo-list.txt" target="_blank">app's markup</a></p>
<br />
<ul>
<li>You'll notice {{ }} and attributes beginning with ng-</li>
<li>Those are the key components of an Angular View!</li>
</ul>
</section>
<section>
<h3>Including Angular</h3>
<p><a href="https://angularjs.org/">Download</a> and serve local file</p>
<pre><code><script src="js/angular.min.js"><script></code></pre>
<p>OR</p>
<p>Use a content distribution network for a cached file</p>
<pre><code><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script></code></pre>
</section>
<section>
<h3>Built-In Directives</h3>
<p>The Angular library looks for these attribute in your markup to know it should render Angular code</p>
<pre><code><body ng-app>
<h1>Hello World!</h1>
</body>
</code></pre>
<p><a href="https://docs.angularjs.org/api/ng/directive/ngApp">ng-app</a> is a required directive used to identify the root element and determine scope</p>
<!-- <small>(We'll cover what this code does shortly!)</small> -->
</section>
<section>
<h3>Expressions</h3>
<p>A way to insert data into html via a JavaScript string, number, object, or array</p>
<pre><code><body ng-app>
<p>I have {{ 1 + 2 }} apples</p>
<p>My cat's name is {{ "Admiral " + "Snuggles" }}</p>
</body></code></pre>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li><a href="demofiles.zip">Download the demo files</a></li>
<li>Open exercises/hello-world/hello-world.html in your text editor</li>
<li>Import the Angular library</li>
<li>Assign your root element with ng-app</li>
<li>Include html with a few string & number expressions </li>
</ul>
</section>
<section>
<h3>Two-Way Data Binding</h3>
<p>The <a href="https://docs.angularjs.org/api/ng/directive/ngModel" target="_blank">ng-model</a> directive binds the value of an <code>input</code>, <code>select</code>, or <code>textarea</code> to an object that can be used in an expression</p>
<pre><code><body ng-app>
<label>Name:</label>
<input type="text" ng-model="yourName">
<hr>
<h1>Hello {{yourName}}!</h1>
</body>
</code></pre>
</section>
<section>
<h3>Two-Way Data Binding</h3>
<p>Expressions can be inserted as the value html attributes as well as text within html tags</p>
<pre><code><body ng-app>
<label>Name:</label>
<input type="text" ng-model="user.status">
<hr>
<h1 class="status-text-{{user.status}}">Your status is: {{user.status}}!</h1>
</body>
</code></pre>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li>In hello-world.html, within your ng-app, add the markup for a form input field</li>
<li>Also add the markup for a heading
<li>Bind the value of the input to text within your heading tags by using ng-model </li>
<li>Try to add a few more data-bindings with ng-model!</li>
</ul>
</section>
<section>
<h3>More Built-In Directives: <br />ng-repeat</h3>
<p>ng-repeat is Angular's way of looping</p>
<pre><code class="xml"><body ng-app>
<ul>
<li ng-repeat="item in ['Sal', 'Jo', 'Amir', 'Maria']">
{{item}} is my friend.
</li>
</ul>
</body>
</code></pre>
</section>
<section>
<h3>More Built-In Directives: <br />ng-if</h3>
<p>ng-if is Angular's <code>if</code> statement</p>
<pre><code class="xml"><body ng-app>
<p ng-if="'Sal' === 'Sal'">True!</p>
<p ng-if="'Sal' === 'Jo'">False!</p>
</body>
</code></pre>
</section>
<section>
<h3>More Built-In Directives: <br />ng-show/ng-hide</h3>
<p><code>ng-show</code> & <code>ng-hide</code> toggle an element's display based on value</p>
<pre><code class="xml"><body ng-app>
<p ng-show="5> 2">Five is greater than two.</p>
<p ng-show="2> 5">Two is greater than five.</p>
</body>
</code></pre>
<small>Note: if the value of <code>ng-show</code> evaluates to false, the element will still live in the DOM</small>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li>In hello-world.html, within your ng-app, use ng-repeat to loop through an array of your favorite TV shows, and display each one on the page</li>
<li>Use ng-show/ng-hide or ng-if to conditionally display an image of your favorite celebrity</li>
</ul>
</section>
<section>
<h3>More Built-In Directives: <br />ng-init</h3>
<p><code>ng-init</code> sets an initial value</p>
<pre><code class="xml"><head>
<!-- add icon font library -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body ng-app>
<nav ng-init="isOpen=false" class="mobile-nav">
<button><i class="fa fa-bars"></i></button>
<ul ng-show="isOpen">
<li>Home</li>
<li>About</li>
<li>Blog</li>
</ul>
</nav>
</body>
</code></pre>
</section>
<section>
<h3>More Built-In Directives: <br />ng-click</h3>
<p>Angular's click listener</p>
<pre><code class="xml"><body ng-app>
<nav ng-init="isOpen = false" class="mobile-nav">
<button ng-click="isOpen = !isOpen">
<i class="fa fa-bars"></i>
</button>
<ul ng-show="isOpen">
<li>Home</li>
<li>About</li>
<li>Blog</li>
</ul>
</nav>
</body>
</code></pre>
<p><small><strong>Bonus!</strong> Angular will make your <code>ng-click</code> elements work with the keyboard too.</small></p>
</section>
<section>
<h3>More Built-In Directives: <br />ng-class</h3>
<p><code>ng-class</code> conditionally adds a class based on value</p>
<pre><code class="xml"><body ng-app>
<nav ng-init="isOpen = false" class="mobile-nav">
<p ng-class="{'highlight': isOpen}">My Menu</p>
<button ng-click="isOpen = !isOpen">
<i class="fa fa-bars"></i>
</button>
<ul ng-show="isOpen">
<li>Home</li>
<li>About</li>
<li>Blog</li>
</ul>
</nav>
</body>
</code></pre>
</section>
<section>
<h3>More Built-In Directives: <br />ng-class</h3>
<p>Here's another example:</p>
<pre><code class="xml"><body ng-app>
<nav ng-init="isOpen = false" class="mobile-nav">
<button ng-click="isOpen = !isOpen">
<i class="fa" ng-class="{
'fa-caret-square-o-down': !isOpen,
'fa-caret-square-o-up': isOpen}">
</i>
</button>
<ul ng-show="isOpen">
<li>Home</li>
<li>About</li>
<li>Blog</li>
</ul>
</nav>
</body>
</code></pre>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li>In hello-world.html, within your ng-app, add a new <code>section</code> or <code>div</code> where you set a value to true or false with <code>ng-init</code></li>
<li>Within that section/div, add a button with an <code>ng-click</code> directive that toggles the <code>ng-init</code> value</li>
<li>Use <code>ng-show</code> or <code>ng-hide</code> to show/hide an image of your pet (or your favorite animal) on click of your button </li>
</ul>
</section>
<section>
<h3>Note!</h3>
<p>It's good to know how ng-init works, but usually you'll use a controller for that purpose</p>
<p class="fragment">Before we talk about controllers, let's talk about modules!</p>
</section>
<section>
<h3>Modules</h3>
<ul>
<li>Where we write pieces of the app and define dependencies</li>
<li>Module names are bound to <code>ng-app</code> directives</li>
</ul>
<pre><code>(function(){
angular.module('myApp', []);
})();
</code></pre>
<pre><code class="xml"><body ng-app="myApp">
<p>I have {{ 1 + 2 }} apples</p>
<p>Our President is {{ "Barack " + "Obama" }}</p>
</body>
</code></pre>
</section>
<section>
<h3>Controllers</h3>
<ul>
<li>They're where most of the app's functionality comes from</li>
<li>They control the data that passes through</li>
<li>They're regular JavaScript Objects</li>
<li>There can be more than one controller in an app</li>
</ul>
</section>
<section>
<h3>Controllers</h3>
<small>in app.js</small>
<pre><code class="js">(function(){
angular
.module('myApp', [])
.controller('MainController', function(){
this.cat = cat;
});
var cat = {
name: 'Ms. Whiskers',
age: 9,
eyes: 'blue'
};
})();
</code></pre>
</section>
<section>
<h3>Controllers</h3>
<small>in index.html</small>
<pre><code class="xml"><body ng-app="myApp">
<section ng-controller="MainController as mainCtrl">
<p>My cat's name is {{mainCtrl.cat.name}}</p>
<p>She has {{mainCtrl.cat.eyes}} eyes and she's
{{mainCtrl.cat.age}} years old.</p>
</section>
</body>
</code></pre>
<small>The scope of the controller is only within the <code>section</code> element!</small>
</section>
<section>
<h3>Exercise — Part 1</h3>
<ul>
<li>In recipe-app/app.js, within the closure, create a module called 'recipeApp', a controller called 'RecipeController', and a variable called 'recipe'</li>
<li>Set the recipe var as an object with a few different properties, like 'name', 'ingredients', 'prepTime', 'cookTime', and 'directions'
<ul><li> Try to set one of these properties (like 'ingredients') as an array</li>
<li>Add two or three new properties as booleans, like 'isVegan', 'isGlutenFree', or 'isPaleo'</li></ul></li>
<li>Set the recipe object as a property of the controller, using the 'this' keyword</li>
</ul>
</section>
<section>
<h3>Exercise — Part 2</h3>
<ul>
<li>In recipe-app/index.html, add an <code>ng-app</code> directive with the value of "recipeApp", and an <code>ng-controller</code> directive with the value of "RecipeController as recipeCtrl"</li>
<li>Include a few expressions referencing properties of the recipe object</li>
<li>Use <code>ng-repeat</code> to iterate over one of your array properties in the recipe object</li>
<li>Use <code>ng-if</code> or <code>ng-show</code> to conditionally display your boolean properties</li>
</ul>
</section>
<section>
<h3>Controllers</h3>
<p>Often your data will be stored in an array, rather than a single object like we've seen so far</p>
<pre><code class="js">(function(){
angular
.module('myApp', [])
.controller('MainController', function(){
this.cats = cats;
});
var cats = [
{
name: 'Ms. Whiskers',
age: 9,
eyes: 'blue'
},
{
name: 'Melvin',
age: 1,
eyes: 'green'
},
{
name: 'Tootsie',
age: 3,
eyes: 'grey'
}
];
})();
</code></pre>
</section>
<section>
<h3>Controllers</h3>
<p>If your data is stored in an array, you'll need to loop through it or access specific items by index number</p>
<pre><code class="xml"><body ng-app="myApp">
<section ng-controller="MainController as mainCtrl">
<article ng-repeat="cat in mainCtrl.cats">
<p>My cat's name is {{cat.name}}</p>
<p>She has {{cat.eyes}} eyes and she's
{{cat.age}} years old.</p>
</article>
</section>
</body>
</code></pre>
</section>
<section>
<h3>Exercise — Part 3</h3>
<ul>
<li>In recipe-app/app.js, change your recipe object to an array of multiple objects and update the var name from 'recipe' to 'recipes'</li>
<li>In recipe-app/index.html, use <code>ng-repeat</code> to loop through your recipes array and display each one on the page</li>
</ul>
</section>
<section>
<h3>Controllers</h3>
<p>Functions can also be stored as properties</p>
<pre><code class="js">//app.js
angular
.module('todoApp', [])
.controller('TodoListController', function() {
var todoList = this;
todoList.todos = [
{text:'learn angular', done:true},
{text:'build an angular app', done:false}
];
todoList.logArg = function(arg) {
console.log(arg);
};
});
</code></pre>
</section>
<section>
<h3>Controllers</h3>
<p>And they can be called by events!</p>
<pre><code class="xml"><!-- index.html -->
<body ng-app="todoApp">
<section ng-controller="TodoListController as todoListCtrl">
<button ng-click="todoListCtrl.logArg('hi!')">
Log me!
</button>
</section>
</body>
</code></pre>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li>Let's look at the todo-list/todo.js & todo-list/todo-list.html</li>
<li>What are the functions in todo.js doing?</li>
<li>Which new directive in todo-list.html haven't we seen yet?</li>
</ul>
</section>
<section>
<h3>Dependency Injection</h3>
<ul>
<li>Dependencies are standalone modules that can be pulled into your project for different uses</li>
<li>They can be included as external files in script tags, or if you're using grunt/gulp, usually they can be included as node modules</li>
<li><a href="http://gregpike.net/demos/angular-local-storage/demo/demo.html">Angular Local Storage</a> is a popular module that uses the browser's local storage to persist your data without saving it to a database</li>
</ul>
</section>
<section>
<h3>Dependency Injection</h3>
<!-- <pre><code><script src="js/angular.localstorage.js"><script></code></pre> -->
<pre><code class="js">angular.module('todoApp', ['LocalStorageModule'])
.controller('TodoListController', function(localStorageService) {
var todoList = this;
// todoList.todos = [
// {text:'learn angular', done:true},
// {text:'build an angular app', done:false}];
var todosInStore = localStorageService.get('myTodos');
todoList.todos = todosInStore || [];
todoList.addTodo = function() {
todoList.todos.push({text:todoList.todoText, done:false});
localStorageService.set('myTodos', todoList.todos);
todoList.todoText = '';
};
[...]
});
</code></pre>
</section>
<section>
<h3>Exercise</h3>
<ul>
<li>Include a script tag in todo-list/todo-list.html to reference localstorage.js</li>
<li>In todo-list/todo.js, include <code>'LocalStorageModule'</code> as a dependency and <code>localStorageService</code> as an argument in your controller callback function </li>
<li>Set a var called <code>todosInStore</code> with the value of <code>localStorageService.get('myTodos')</code></li>
</ul>
</section>
<section>
<h3>Exercise...continued</h3>
<ul>
<li>Comment out the array of <code>todoList.todos</code>, and set <code>todoList.todos</code> to: <code>todosInStore || []</code></li>
<li>Within your <code>addTodo</code> function, before the line that sets an empty string, add a function to set local storage with the array of todos as its updated (<code>localStorageService.set('myTodos', todoList.todos);</code>)</li>
</ul>
</section>
<section>
<h3>$scope</h3>
<ul>
<li><a href="https://docs.angularjs.org/guide/scope">Angular scope</a> is an object that refers to the application model</li>
<li>In this workshop so far, we've been avoiding using <code>$scope</code> in favor of using <code>this</code> in our controllers to reference the application model</li>
<li>That's mainly because the <code>$scope</code> object is being phased out of Angular, and using <code>this</code> with <a href="http://toddmotto.com/digging-into-angulars-controller-as-syntax/">'controller as' syntax</a> is now considered best practice</li>
</ul>
</section>
<section>
<h3>$scope</h3>
<ul>
<li>That said, at this point, we do still need to use the <code>$scope</code> object if we want to use some of the cool Angular features that come with it</li>
<li>For example, <code>$watch</code> is an API that watches/listens for changes in user input, and can run callback functions when changes occur</li>
<li>We can use <code>$scope.$watch</code> to save our checked off todo list items to local storage</li>
</ul>
</section>
<section>
<h3>$scope.$watch</h3>
<pre><code>angular.module('todoApp', ['LocalStorageModule'])
.controller('TodoListController', function($scope, localStorageService) {
var todoList = this;
var todosInStore = localStorageService.get('myTodos');
todoList.todos = todosInStore || [];
$scope.$watch('todoList.todos', function () {
localStorageService.set('myTodos', todoList.todos);
}, true);
todoList.addTodo = function() {
todoList.todos.push({text:todoList.todoText, done:false});
//localStorageService.set('myTodos', todoList.todos);
todoList.todoText = '';
};
[...]
});
</code></pre>
</section>
<section>
<h3>From here onward...</h3>
<p>There are many more things you can do with Angular!</p>
<ul>
<li>Set up <a href="http://www.ng-newsletter.com/posts/directives.html">custom directives</a></li>
<li>Connect to external API's via <a href="https://docs.angularjs.org/api/ng/service/$http">$http</a></li>
<li>Store data in a <a href="http://adrianmejia.com/blog/2014/09/28/angularjs-tutorial-for-beginners-with-nodejs-expressjs-and-mongodb/">database</a></li>
</ul>
</section>
<section>
<h3>Angular 2.0</h3>
<ul>
<li>Sometime in 2016, Angular 2.0 will be released</li>
<li>It will be a rewrite largely based on ES6</li>
<li>The global <code>$scope</code> object & jqLite will be removed</li>
<li>The implementation of directives and controllers will change</li>
<li>But don't worry! The fundamentals you've learned in this workshop will live on!</li>
<li><a href="https://www.airpair.com/angularjs/posts/preparing-for-the-future-of-angularjs">Preparing for the Future of AngularJS</a></li>
</ul>
</section>
<section>
<h3>Next Steps</h3>
<ul>
<li>Read Up!
<ul>
<li><a href="http://www.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/">Journey Through the JavaScript MVC Jungle</a></li>
<li><a href="http://todomvc.com/">todomvc.com</a></li>
<li><a href="https://www.ng-book.com/">ng-book: The Complete Book on AngularJS</a></li>
<li><a href="http://www.ng-newsletter.com/">ng-newsletter</a></li>
</ul>
</li>
<li>Practice!
<ul><li><a href="http://www.codecademy.com/learn/learn-angularjs">Codeacademy AngularJS Course</a></li>
<li><a href="http://teamtreehouse.com/library/angularjs">Treehouse AngularJS Course</a></li>
<li><a href="https://www.codeschool.com/paths/javascript">Beginner & Intermediate AngularJS Course on CodeSchool</a></li>
<li><a href="http://www.cheatography.com/proloser/cheat-sheets/angularjs/">AngularJS Cheatsheet</a></li></ul>
</li>
</ul>
</section>
<section>
<h3>Next Steps</h3>
<ul>
<li>Build Something!
<ul><li>FAQ list, gallery, quiz, calculator, or whatever else you can cook up!</li></ul>
</li>
</ul>
</section>
<section>
<h2>Questions?</h2>
<div style="font-size:1200%; height:100%; margin-top:30%">?
<div class="clear"></div></div>
</section>
</div>
<footer>
<div class="copyright">
HTML/CSS ~ Girl Develop It
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</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,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.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, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/accessibility-helper/js/accessibility-helper.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>