208
208
#[ b Create the component file]
209
209
#[ code #[ + adjExPath('app/app.component.ts' )] ] (in this newly created directory) with the following content:
210
210
211
- + makeExample( 'quickstart/ts/ app/app.component.ts' , '' , 'app/app.component.ts' ) ( format = '. ')
211
+ + makeExample1( ' app/app.component.ts' )
212
212
213
213
.l-verbose-section
214
214
:marked
241
241
Here we import the Angular 2 core so that our component code can have access to
242
242
the `@Component` #{_decorator}.
243
243
244
- + makeExcerpt('quickstart/ts/ app/app.component.ts' , 'import' , 'app/app.component.ts (import) ' )
244
+ + makeExcerpt('app/app.component.ts' , 'import' )
245
245
246
246
h3#component-decorator @Component #{_decorator}
247
247
+ ifDocsFor('ts' )
254
254
component class.
255
255
The metadata tells Angular how to create and use this component.
256
256
257
- + makeExcerpt('quickstart/ts/ app/app.component.ts' , 'metadata' , 'app/app.component.ts (metadata)' ) ( format = '. ')
257
+ + makeExcerpt('app/app.component.ts' , 'metadata' )
258
258
259
259
block annotation-fields
260
260
:marked
279
279
:marked
280
280
### Component class
281
281
At the bottom of the file is an empty, do-nothing class named `AppComponent`.
282
- + makeExcerpt('quickstart/ts/ app/app.component.ts' , 'class' , 'app/app.component.ts (class) ' )
282
+ + makeExcerpt('app/app.component.ts' , 'class' )
283
283
:marked
284
284
When we're ready to build a substantive application,
285
285
we can expand this class with properties and application logic.
@@ -297,7 +297,7 @@ block create-main
297
297
Now we need something to tell Angular to load the root component.
298
298
Create the file #[ code #[ + adjExPath('app/main.ts' )] ] with the following content:
299
299
300
- + makeExample( 'quickstart/ts/ app/main.ts' , '' , 'app/main.ts' ) ( format = '. ')
300
+ + makeExample1( ' app/main.ts' )
301
301
302
302
.l-verbose-section
303
303
:marked
@@ -342,7 +342,7 @@ h2#index Step 4: Add #[code index.html]
342
342
In the *#{_indexHtmlDir}* folder
343
343
create an `index.html` file and paste the following lines into it:
344
344
345
- + makeExample( 'quickstart/ts/ index.html' , '' , 'index.html' ) ( format = '. ')
345
+ + makeExample1( ' index.html' )
346
346
347
347
.l-verbose-section
348
348
:marked
@@ -360,7 +360,7 @@ h2#index Step 4: Add #[code index.html]
360
360
:marked
361
361
### Libraries
362
362
We loaded the following scripts
363
- + makeExcerpt('quickstart/ts/ index.html' , 'libraries' , 'index.html ' )
363
+ + makeExcerpt('index.html' , 'libraries' )
364
364
:marked
365
365
We begin with es6-shim which monkey patches the global context (window) with essential features of ES2015 (ES6).
366
366
Next are the polyfills for Angular2, `zone.js` and `reflect-metadata`.
@@ -407,7 +407,7 @@ h2#index Step 4: Add #[code index.html]
407
407
408
408
Our QuickStart makes such requests when one of its
409
409
application TypeScript files has an import statement like this:
410
- + makeExcerpt('quickstart/ts/ app/main.ts' , 'app-component' , 'main.ts (excerpt) ' )
410
+ + makeExcerpt('app/main.ts' , 'import ' )
411
411
:marked
412
412
Notice that the module name (after `from`) does not mention a filename extension.
413
413
In the configuration we tell SystemJS to default the extension to `js`, a JavaScript file.
@@ -463,7 +463,7 @@ h2#index Step 4: Add #[code index.html]
463
463
Create a `styles.css` file in the *#{_indexHtmlDir}* folder and start styling, perhaps with the minimal
464
464
styles shown below. For the full set of master styles used by the documentation samples,
465
465
see [styles.css](https://github.com/angular/angular.io/blob/master/public/docs/_examples/styles.css).
466
- + makeExcerpt('quickstart/ts/ styles.1.css' , '' , 'styles .css' )
466
+ + makeExcerpt('styles.1.css' )
467
467
468
468
.l-main-section
469
469
h2#build-and-run Step 5: Build and run the app!
0 commit comments