Skip to content

Commit a01e0cc

Browse files
committed
docs(quickstart): JS IE Polyfill; change ES6->ES2015
closes angular#715, incorporates angular#684
1 parent 44f84da commit a01e0cc

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed

public/docs/_examples/quickstart/js/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
<!-- 1. Load libraries -->
99
<!-- #docregion libraries -->
10+
<!-- #docregion ie-polyfills -->
11+
<!-- IE required polyfill -->
12+
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
13+
<!-- #enddocregion ie-polyfills -->
14+
1015
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
1116
<script src="node_modules/rxjs/bundles/Rx.umd.js"></script>
1217
<script src="node_modules/angular2/bundles/angular2-all.umd.js"></script>

public/docs/js/latest/quickstart.jade

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ code-example(format="").
247247
:marked
248248
There are three noteworthy sections of HTML:
249249

250-
1. We load the JavaScript libraries we need. `angular2-polyfills.js` and `Rx.js` are needed by Angular 2.<br/>
250+
1. We load the JavaScript libraries we need; learn about them [below](#libraries).
251251

252252
2. We load our JavaScript files, paying attention to their order (`boot.js` needs `app.component.js` to be there first).
253253

@@ -279,7 +279,7 @@ figure.image-display
279279
.alert.is-helpful
280280
:marked
281281
If you see `Loading...` displayed instead, see the
282-
[Browser ES6 support appendix](#es6support).
282+
[Browser ES2015 support appendix](#es6support).
283283
:marked
284284
### Make some changes
285285

@@ -346,18 +346,37 @@ figure.image-display
346346
elaborate some of the points we covered quickly above.
347347

348348
There is no essential material here. Continued reading is for the curious.
349-
349+
350+
<a id="ie-polyfills"></a>
351+
<a id="es6support"></a>
352+
<a id="libraries"></a>
350353
.l-main-section
351354
:marked
352-
<a id="es6support"></a>
353-
### Appendix: Browser ES6 support
354-
Angular 2 relies on some ES2015 features, most of them found in modern
355-
browsers. Some browsers (including IE 11) require a shim to support the
356-
the needed functionality.
357-
Try loading the following shim *above* the other scripts in the `index.html`:
355+
### Appendix: Libraries
356+
We loaded the following scripts
357+
+makeExample('quickstart/js/index.html', 'libraries', 'index.html')(format=".")
358+
:marked
359+
We began with an Internet Explorer polyfill.
360+
IE requires a polyfill to run
361+
an application that relies on ES2015 promises and dynamic module loading.
362+
Most applications need those capabilities and most applications
363+
should run in Internet Explorer.
364+
365+
Next are the polyfills for Angular2, `angular2-polyfills.js`,
366+
followed by the Reactive Extensions RxJS library.
367+
.l-sub-section
368+
:marked
369+
Our QuickStart doesn't use the Reactive Extensions
370+
but any substantial application will want them
371+
when working with observables.
372+
We added the library here in QuickStart so we don't forget later.
373+
:marked
374+
Finally, we loaded the web development version of Angular 2 itself.
358375

359-
code-example(language="html" format=".").
360-
&lt;script src=&quot;node_modules/es6-shim/es6-shim.js&quot;&gt;&lt;/script&gt;
376+
We'll make different choices as we gain experience and
377+
become more concerned about production qualities such as
378+
load times and memory footprint.
379+
.l-main-section
361380
:marked
362381

363382

@@ -406,15 +425,15 @@ code-example(format="").
406425
<a id="npm-errors"></a>
407426
### Appendix: Npm errors and warnings
408427

409-
All is well if there are no console messages starting with `npm ERR!` *at the end* of an **npm install**.
428+
All is well if there are no console messages starting with `npm ERR!` *at the end* of **npm install**.
410429
There might be a few `npm WARN` messages along the way &mdash; and that is perfectly fine.
411430

412431
We often see an `npm WARN` message after a series of `gyp ERR!` messages.
413432
Ignore them. A package may try to re-compile itself using `node-gyp`.
414433
If the re-compile fails, the package recovers (typically with a pre-built version)
415434
and everything works.
416435

417-
We are in good shape as long as there are no `npm ERR!` messages at the very end of `npm install`.
436+
Just make sure there are no `npm ERR!` messages at the very end of `npm install`.
418437

419438
.l-main-section
420439
:marked

public/docs/ts/latest/guide/router.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ code-example(format=".", language="bash").
14431443
.l-main-section
14441444
:marked
14451445
## Appendix: Internet Explorer polyfills
1446-
A routed application relies on ES6 promises and dynamic module loading.
1446+
A routed application relies on ES2015 promises and dynamic module loading.
14471447
IE needs help with that.
14481448
Make sure the following polyfill libraries are loaded in the `index.html`
14491449
***above*** the Angular polyfill:

public/docs/ts/latest/quickstart.jade

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ figure.image-display
343343

344344
<a id="ie-polyfills"></a>
345345
<a id="es6support"></a>
346+
<a id="libraries"></a>
346347
.l-main-section
347348
:marked
348349
### Appendix: Libraries
@@ -351,7 +352,7 @@ figure.image-display
351352
:marked
352353
We began with Internet Explorer polyfills.
353354
IE requires polyfills to run
354-
an application that relies on ES6 promises and dynamic module loading.
355+
an application that relies on ES2015 promises and dynamic module loading.
355356
Most applications need those capabilities and most applications
356357
should run in Internet Explorer.
357358
.l-sub-section
@@ -423,15 +424,15 @@ code-example(format="").
423424
<a id="npm-errors"></a>
424425
### Appendix: Npm errors and warnings
425426

426-
All is well if there are no console messages starting with `npm ERR!` *at the end* of an **npm install**.
427+
All is well if there are no console messages starting with `npm ERR!` *at the end* of **npm install**.
427428
There might be a few `npm WARN` messages along the way &mdash; and that is perfectly fine.
428429

429430
We often see an `npm WARN` message after a series of `gyp ERR!` messages.
430431
Ignore them. A package may try to re-compile itself using `node-gyp`.
431432
If the re-compile fails, the package recovers (typically with a pre-built version)
432433
and everything works.
433434

434-
We are in good shape as long as there are no `npm ERR!` messages at the very end of `npm install`.
435+
Just make sure there are no `npm ERR!` messages at the very end of `npm install`.
435436

436437
<!-- Move this to the Style Guide when we have one -->
437438
.l-main-section

0 commit comments

Comments
 (0)