QS revisions.
This commit is contained in:
parent
55072f00a4
commit
c9f6c832b4
|
@ -18,19 +18,18 @@
|
||||||
code git clone https://github.com/davideast/concious.git es6-shim
|
code git clone https://github.com/davideast/concious.git es6-shim
|
||||||
|
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
h3 A word on ES6
|
h3 The <code>es6-shim</code>
|
||||||
p.
|
p.
|
||||||
Angular builds on top of ES6, the new specification of the JavaScript language.
|
Angular builds on top of ES6, the new specification of the JavaScript language.
|
||||||
Not all ES6 features are available in all browsers. The following es6-shim
|
ES6 is not widely supported in all browsers today. The following es6-shim
|
||||||
repository allows you to use ES6 in the browser today.
|
repository allows you to use ES6 in the browser.
|
||||||
|
|
||||||
p.
|
|
||||||
Angular is available on npm. Configuring Angular to run ES6 in the browser
|
|
||||||
requires a build process, detailed here.
|
|
||||||
|
|
||||||
p.
|
p.
|
||||||
The es6-shim package includes Angular and dependencies needed to compile
|
The es6-shim package includes Angular and dependencies needed to compile
|
||||||
ES6 in the browser. Think of the es6-shim repository as package rather than a new project.
|
ES6 in the browser, such as Traceur. Traceur is an ES6 compiler that transpiles ES6 to ES5 code.
|
||||||
|
|
||||||
|
p.
|
||||||
|
Think of the es6-shim repository as package rather than a new project.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +41,10 @@
|
||||||
This quickstart will consist of two files, an <code>index.html</code> and a
|
This quickstart will consist of two files, an <code>index.html</code> and a
|
||||||
<code>app.es6</code>. Both of these files will be at the root of the project.
|
<code>app.es6</code>. Both of these files will be at the root of the project.
|
||||||
The <code>.es6</code> extension signifies that the file uses ES6 syntax.
|
The <code>.es6</code> extension signifies that the file uses ES6 syntax.
|
||||||
Using the ES6 module syntax you can import the required modules from Angular2.
|
|
||||||
|
p This quickstart will create a component that renders "Hello Alice" to the page.
|
||||||
|
|
||||||
|
p Using the ES6 module syntax you can import the required modules from Angular2.
|
||||||
|
|
||||||
pre.prettyprint.linenums
|
pre.prettyprint.linenums
|
||||||
code import {Component, Template, bootstrap} from 'angular2/angular2';
|
code import {Component, Template, bootstrap} from 'angular2/angular2';
|
||||||
|
@ -74,9 +76,7 @@
|
||||||
selector: 'my-app'
|
selector: 'my-app'
|
||||||
})
|
})
|
||||||
@Template({
|
@Template({
|
||||||
inline: `
|
inline: `<h1>Hello {{ name }}</h1>`
|
||||||
<h1>Hello {{ name }}</h1>
|
|
||||||
`
|
|
||||||
})
|
})
|
||||||
// Component Controller
|
// Component Controller
|
||||||
class MyAppComponent {
|
class MyAppComponent {
|
||||||
|
@ -170,10 +170,8 @@
|
||||||
h2#section-angular-create-account 5. Declare the HTML
|
h2#section-angular-create-account 5. Declare the HTML
|
||||||
|
|
||||||
p.
|
p.
|
||||||
Create an <code>index.html</code> file at the root of the project.
|
Inside of the <code>index.html</code>, include the <code>es6-shim.js</code> file in the <code>head</code> tag.
|
||||||
Include the <code>es6-shim.js</code> file in the <code>head</code> tag.
|
Now, declare the app component the <code>body</code>. The es6-shim must load before any application code.
|
||||||
Now, declare the app component the <code>body</code>. The es6-shim must
|
|
||||||
load before any application code.
|
|
||||||
|
|
||||||
pre.prettyprint.linenums
|
pre.prettyprint.linenums
|
||||||
code.
|
code.
|
||||||
|
|
Loading…
Reference in New Issue