Skip to content

Commit 4671777

Browse files
pbatchupbatchu
authored andcommitted
got to till the TODO app demo (begin)
1 parent 00caf2d commit 4671777

File tree

3 files changed

+58
-12
lines changed

3 files changed

+58
-12
lines changed

AngularJS/img/concepts-runtime.png

39.8 KB
Loading

AngularJS/img/concepts-startup.png

34 KB
Loading

AngularJS/index.html

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -334,37 +334,83 @@ <h3>Directives</h3>
334334
<img src="img/reuse2.png" />
335335

336336
<aside class="notes">
337-
And its not just tabs. Think about all these components that you could build using this features.
337+
And its not just tabs. Think about all these components that you could build using this feature. You can also share it within/outside of your project. These components can be stateless or stateful.
338338
</aside>
339339
</section>
340-
<section>
341-
<iframe width="100%" height="700" src="http://jsfiddle.net/uhsarp/qZjrW/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
342-
</section>
340+
343341
<section>
344342

345343
<img src="img/reuse3.png" />
344+
<aside class="notes">
345+
So reusable components feature in Angular is built with existing JS & DOM APIs. It's available in all the browsers. And it is also being proposed to become native for all modern browsers. It's already been implemented in Chrome Dev versions.
346+
</aside>
346347
</section>
347-
<section>
348348

349-
</section>
350349
</section>
351350
<section>
352351

353352
<section>
354-
<h2>Examples</h2>
355-
353+
<h3>Examples</h3>
354+
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/d7Y76/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
355+
356+
<img src="img/concepts-startup.png" />
357+
<img src="img/concepts-runtime.png" />
358+
<aside class="notes">
359+
<ul>
360+
<li>The browser loads the HTML and parses it into a DOM</li>
361+
<li>The browser loads <code>angular.js</code> script</li>
362+
<li>Angular waits for <code>DOMContentLoaded</code> event</li>
363+
<li>Angular looks for <a href="api/ng.directive:ngApp"><code>ng-app</code></a>
364+
<a href="guide/directive">directive</a>, which designates the application boundary</li>
365+
<li>The <a href="guide/module">Module</a> specified in <a href="api/ng.directive:ngApp"><code>ng-app</code></a> (if any) is used to configure
366+
the <a href="api/AUTO.$injector"><code>$injector</code></a></li>
367+
<li>The <a href="api/AUTO.$injector"><code>$injector</code></a> is used to create the <a href="api/ng.$compile"><code>$compile</code></a> service as well as <a href="api/ng.$rootScope"><code>$rootScope</code></a></li>
368+
<li>The <a href="api/ng.$compile"><code>$compile</code></a> service is used to compile the DOM and link
369+
it with <a href="api/ng.$rootScope"><code>$rootScope</code></a></li>
370+
<li>The <a href="api/ng.directive:ngInit"><code>ng-init</code></a> <a href="guide/directive">directive</a> assigns <code>World</code> to the <code>name</code> property on the <a href="guide/scope">scope</a></li>
371+
<li>The <code>{{name}}</code> <a href="api/ng.$interpolate"><code>interpolates</code></a> the expression to
372+
<code>Hello World!</code></li>
373+
</aside>
356374
</section>
357375
<section>
358-
Intro Example
359-
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/QSFh7/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
376+
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/QSFh7/2/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
377+
<aside class="notes">
378+
<ol>
379+
<li>During the compilation phase:
380+
<ol><li>the <a href="api/ng.directive:ngModel"><code>ng-model</code></a> and <a href="api/ng.directive:input"><code>input</code></a> <a href="guide/directive">directive</a> set up a <code>keydown</code> listener on the <code>&lt;input&gt;</code> control.</li>
381+
<li>the <a href="api/ng.$interpolate"><code>{{name}}</code></a> interpolation
382+
sets up a <a href="api/ng.$rootScope.Scope#$watch"><code>$watch</code></a> to be notified of
383+
<code>name</code> changes.</li></ol></li>
384+
<li>During the runtime phase:
385+
<ol><li>Pressing an '<code>X</code>' key causes the browser to emit a <code>keydown</code> event on the input control.</li>
386+
<li>The <a href="api/ng.directive:input"><code>input</code></a> directive
387+
captures the change to the input's value and calls <a href="api/ng.$rootScope.Scope#$apply"><code>$apply</code></a><code>("name = 'X';")</code> to update the
388+
application model inside the Angular execution context.</li>
389+
<li>Angular applies the <code>name = 'X';</code> to the model.</li>
390+
<li>The <a href="api/ng.$rootScope.Scope#$digest"><code>$digest</code></a> loop begins</li>
391+
<li>The <a href="api/ng.$rootScope.Scope#$watch"><code>$watch</code></a> list detects a change
392+
on the <code>name</code> property and notifies the <a href="api/ng.$interpolate"><code>{{name}}</code></a> interpolation, which in turn updates the DOM.</li>
393+
<li>Angular exits the execution context, which in turn exits the <code>keydown</code> event and with it
394+
the JavaScript execution context.</li>
395+
<li>The browser re-renders the view with update text.</li></ol></li>
396+
</ol>
397+
</aside>
398+
</section>
399+
400+
<section>
401+
TODO App
402+
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/SyaFT/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
360403
</section>
361404
<section>
362405
<img src="img/scope.png" />
406+
407+
363408
</section>
364409
<section>
365-
Data Binding
366-
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/SyaFT/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
410+
Directives
411+
<iframe width="100%" height="700" src="http://jsfiddle.net/uhsarp/qZjrW/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
367412
</section>
413+
368414
<section>
369415
Wiring a Backend
370416
<iframe width="100%" height="300" src="http://jsfiddle.net/uhsarp/upv84/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

0 commit comments

Comments
 (0)