Quickstart - Module loading
This commit is contained in:
parent
c1aa128527
commit
9fdb7b3dbb
@ -45,10 +45,6 @@
|
|||||||
.c11
|
.c11
|
||||||
header
|
header
|
||||||
|
|
||||||
// Angular is a component based framework.
|
|
||||||
// Components are custom HTML elements.
|
|
||||||
// Components are used to structure and represent the UI.
|
|
||||||
|
|
||||||
h3#section-angular-create-account Create a component
|
h3#section-angular-create-account Create a component
|
||||||
p
|
p
|
||||||
| Angular allows you to create custom HTML elements through components. Components are used to structure and represent the UI. This quickstart demonstrates the process of creating a <code>Component</code> with the HTML tag of <code>app</code>.
|
| Angular allows you to create custom HTML elements through components. Components are used to structure and represent the UI. This quickstart demonstrates the process of creating a <code>Component</code> with the HTML tag of <code>app</code>.
|
||||||
@ -119,6 +115,7 @@
|
|||||||
| In the template above binds to a <code>name</code> property through the <code>{{ }}</code> syntax. In the component's constructor the name property is being set to Alice. When the template is rendered, Alice will appear instead of <code>{{ name }}</code>.
|
| In the template above binds to a <code>name</code> property through the <code>{{ }}</code> syntax. In the component's constructor the name property is being set to Alice. When the template is rendered, Alice will appear instead of <code>{{ name }}</code>.
|
||||||
.clear
|
.clear
|
||||||
|
|
||||||
|
// STEP 4 - Bootstrap ##########################
|
||||||
.content-block.content-number.clearfix
|
.content-block.content-number.clearfix
|
||||||
i.number.icon-number4.large
|
i.number.icon-number4.large
|
||||||
|
|
||||||
@ -139,15 +136,63 @@
|
|||||||
pre bootstrap(App);
|
pre bootstrap(App);
|
||||||
.clear
|
.clear
|
||||||
|
|
||||||
|
// STEP 5 - Declare the HTML ##########################
|
||||||
|
.content-block.content-number.clearfix
|
||||||
|
i.number.icon-number5.large
|
||||||
|
.c11
|
||||||
|
header
|
||||||
|
|
||||||
|
h3#section-angular-create-account Declare the HTML
|
||||||
|
p
|
||||||
|
| Create a <code>index.html</code> file at the root of the project. Include the <code>es6-shim.js</code> file in the <code>head</code> tag. Once the shim is included the <code>app</code> component can be declared in the HTML.
|
||||||
|
|
||||||
|
code
|
||||||
|
pre
|
||||||
|
| <html>
|
||||||
|
| <head>
|
||||||
|
| <title>Angular 2 Quickstart</title>
|
||||||
|
| </head>
|
||||||
|
| <body>
|
||||||
|
| <!-- -->
|
||||||
|
| <!-- The app component created in app.es6 -->
|
||||||
|
| <app></app>
|
||||||
|
| <!-- -->
|
||||||
|
| </body>
|
||||||
|
| </html>
|
||||||
|
|
||||||
section.docs-sub-section
|
section.docs-sub-section
|
||||||
h4 Declare the HTML
|
h4 Load the component module
|
||||||
.c6
|
.c6
|
||||||
p
|
p
|
||||||
| Create a <code>index.html</code> file.
|
| The last step is to load the module for the <code>app</code> component. The <code>es6-shim</code> file comes packaged with the <code>System</code> library, which is the current polyfill for ES6 module loading. <code>System</code> will allow you to load modules in browsers that do not support ES6 module loading.
|
||||||
|
|
||||||
|
p
|
||||||
|
|
|
||||||
|
|
||||||
code
|
code
|
||||||
pre <app></app>
|
pre
|
||||||
.clear
|
| <html>
|
||||||
|
| <head>
|
||||||
|
| <title>Angular 2 Quickstart</title>
|
||||||
|
| </head>
|
||||||
|
| <body>
|
||||||
|
| <!-- -->
|
||||||
|
| <!-- The app component created in app.es6 -->
|
||||||
|
| <app></app>
|
||||||
|
| <!-- -->
|
||||||
|
| <script>
|
||||||
|
| // Rewrite the paths to load the files
|
||||||
|
| System.paths = {
|
||||||
|
| 'angular2/*':'/es6-shim/angular2/*.js',
|
||||||
|
| 'rtts_assert/*': '/es6-shim/rtts_assert/*.js',
|
||||||
|
| 'app': 'app.es6'
|
||||||
|
| };
|
||||||
|
| <!-- -->
|
||||||
|
| System.import('app');
|
||||||
|
| </script>
|
||||||
|
| </body>
|
||||||
|
| </html>
|
||||||
|
.clear
|
||||||
|
|
||||||
.content-block.content-number.clearfix
|
.content-block.content-number.clearfix
|
||||||
i.number.icon-number6.large
|
i.number.icon-number6.large
|
||||||
|
Loading…
x
Reference in New Issue
Block a user