From 06f80024170337bccac9c204544e98fff074a3df Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 6 Jun 2016 18:10:37 -0400 Subject: [PATCH 0001/1217] docs(pipes): minor text updates closes #1611 --- public/docs/ts/latest/guide/pipes.jade | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/docs/ts/latest/guide/pipes.jade b/public/docs/ts/latest/guide/pipes.jade index 1f453d0a29..e92b94ae58 100644 --- a/public/docs/ts/latest/guide/pipes.jade +++ b/public/docs/ts/latest/guide/pipes.jade @@ -16,7 +16,7 @@ block includes We almost think of them as styles. In fact, we'd like to apply them in our HTML templates as we do styles. p. - Welcome, Angular pipes, the simple display-value transformations that we can declare in our HTML! + Introducing Angular pipes, a way to write display-value transformations that we can declare in our HTML! Try the #[+liveExampleLink2()]. .l-main-section @@ -25,7 +25,7 @@ p. A pipe takes in data as input and transforms it to a desired output. We'll illustrate by transforming a component's birthday property into - a human-friendly date: + a human-friendly date. +makeExample('pipes/ts/app/hero-birthday1.component.ts', null, 'app/hero-birthday1.component.ts')(format='.') @@ -62,7 +62,7 @@ p. (e.g., `currency:'EUR'`). If our pipe accepts multiple parameters, we separate the values with colons (e.g. `slice:1:5`) We'll modify our birthday template to give the date pipe a format parameter. - After formatting the hero's April 15th birthday, it should render as **04/15/88**. + After formatting the hero's April 15th birthday, it should render as **04/15/88**: +makeExample('pipes/ts/app/app.component.html', 'format-birthday')(format=".") @@ -103,7 +103,7 @@ figure.image-display We can chain pipes together in potentially useful combinations. In the following example, we chain the birthday to the `DatePipe` and on to the `UpperCasePipe` so we can display the birthday in uppercase. The following birthday displays as - **APR 15, 1988** + **APR 15, 1988**. +makeExample('pipes/ts/app/app.component.html', 'chained-birthday')(format=".") @@ -123,7 +123,7 @@ figure.image-display +makeExample('pipes/ts/app/exponential-strength.pipe.ts', null, 'app/exponential-strength.pipe.ts')(format=".") :marked - This pipe definition reveals several key points + This pipe definition reveals several key points: * A pipe is a class decorated with pipe metadata. From f7cf6fde9f3efc4490faf59d34c52902ce753d95 Mon Sep 17 00:00:00 2001 From: jevonearth Date: Sat, 4 Jun 2016 13:09:43 -0700 Subject: [PATCH 0002/1217] docs(toh-6): Fix typo in 'Add/Delete in the HeroesComponent' section. closes #1603 --- public/docs/ts/latest/tutorial/toh-pt6.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/docs/ts/latest/tutorial/toh-pt6.jade b/public/docs/ts/latest/tutorial/toh-pt6.jade index 47f8ab7415..06f07ade49 100644 --- a/public/docs/ts/latest/tutorial/toh-pt6.jade +++ b/public/docs/ts/latest/tutorial/toh-pt6.jade @@ -289,7 +289,7 @@ figure.image-display +makeExample('toh-6/ts/app/heroes.component.ts', 'add', 'app/heroes.component.ts (add)')(format=".") :marked The `HeroDetailComponent` does most of the work. All we do is toggle an `*ngIf` flag that - swaps it into the DOM when were add a hero and remove it from the DOM when the user is done. + swaps it into the DOM when we add a hero and removes it from the DOM when the user is done. The *delete* logic is a bit trickier. +makeExample('toh-6/ts/app/heroes.component.ts', 'delete', 'app/heroes.component.ts (delete)')(format=".") From afee8dbe7efcfad705da1af0700b14cfb7615c6d Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 7 Jun 2016 14:59:41 -0700 Subject: [PATCH 0003/1217] docs(toh-1/dart): minor edits (#1614) - Fixed HTML. - Removed unnecessary snippet since it is in the code. - Copyedit (Hero Property) -> (Hero property). --- .../toh-1/dart-snippets/app_component_snippets_pt1.dart | 6 +----- public/docs/_examples/toh-1/dart/lib/app_component.dart | 4 +++- public/docs/_examples/toh-1/dart/web/main.dart | 2 +- public/docs/dart/latest/tutorial/toh-pt1.jade | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart b/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart index b3a4e60eaf..8b21290440 100644 --- a/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart +++ b/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart @@ -25,7 +25,7 @@ template: '''
{{hero.id}}
-
+
''' // #enddocregion editing-Hero @@ -35,7 +35,3 @@ class AppComponent { Hero hero = 'Windstorm'; } // #enddocregion app-component-1 - -// #docregion hero-property-1 -Hero hero = new Hero(1, 'Windstorm'); -// #enddocregion hero-property-1 diff --git a/public/docs/_examples/toh-1/dart/lib/app_component.dart b/public/docs/_examples/toh-1/dart/lib/app_component.dart index 7fa504adbf..362d8b3004 100644 --- a/public/docs/_examples/toh-1/dart/lib/app_component.dart +++ b/public/docs/_examples/toh-1/dart/lib/app_component.dart @@ -18,11 +18,13 @@ class Hero {
{{hero.id}}
-
+
''' ) class AppComponent { String title = 'Tour of Heroes'; + // #docregion hero-property-1 Hero hero = new Hero(1, 'Windstorm'); + // #enddocregion hero-property-1 } // #enddocregion pt1 diff --git a/public/docs/_examples/toh-1/dart/web/main.dart b/public/docs/_examples/toh-1/dart/web/main.dart index 81c22cd91d..dbf48b9c70 100644 --- a/public/docs/_examples/toh-1/dart/web/main.dart +++ b/public/docs/_examples/toh-1/dart/web/main.dart @@ -3,7 +3,7 @@ import 'package:angular2/platform/browser.dart'; import 'package:angular2_tour_of_heroes/app_component.dart'; -main() { +void main() { bootstrap(AppComponent); } // #enddocregion pt1 diff --git a/public/docs/dart/latest/tutorial/toh-pt1.jade b/public/docs/dart/latest/tutorial/toh-pt1.jade index e96613a628..cb6d389286 100644 --- a/public/docs/dart/latest/tutorial/toh-pt1.jade +++ b/public/docs/dart/latest/tutorial/toh-pt1.jade @@ -87,7 +87,7 @@ code-example(format="" language="bash"). Now that we have a `Hero` class, let’s refactor our component’s `hero` property to be of type `Hero`. Then initialize it with an id of `1` and the name, "Windstorm". -+makeExample('toh-1/dart-snippets/app_component_snippets_pt1.dart', 'hero-property-1', 'app_component.dart (Hero property)')(format=".") ++makeExample('toh-1/dart/lib/app_component.dart', 'hero-property-1', 'app_component.dart (hero property)')(format=".") :marked Because we changed the hero from a string to an object, From 7e52648ee7ac8e78a0f472f3c6d3bbbf31fb0ada Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 7 Jun 2016 15:51:25 -0700 Subject: [PATCH 0004/1217] docs(toh): update live example links (#1602) --- public/docs/dart/latest/tutorial/index.jade | 3 +-- public/docs/dart/latest/tutorial/toh-pt1.jade | 6 ++---- public/docs/dart/latest/tutorial/toh-pt2.jade | 6 ++---- public/docs/dart/latest/tutorial/toh-pt3.jade | 3 +-- public/docs/dart/latest/tutorial/toh-pt4.jade | 5 ++--- public/docs/dart/latest/tutorial/toh-pt5.jade | 7 +++---- public/docs/ts/latest/tutorial/index.jade | 3 +-- public/docs/ts/latest/tutorial/toh-pt1.jade | 12 ++++++------ public/docs/ts/latest/tutorial/toh-pt2.jade | 10 +++++----- public/docs/ts/latest/tutorial/toh-pt3.jade | 4 ++-- public/docs/ts/latest/tutorial/toh-pt4.jade | 10 +++++----- public/docs/ts/latest/tutorial/toh-pt5.jade | 12 +++++++----- public/docs/ts/latest/tutorial/toh-pt6.jade | 6 +++--- 13 files changed, 40 insertions(+), 47 deletions(-) diff --git a/public/docs/dart/latest/tutorial/index.jade b/public/docs/dart/latest/tutorial/index.jade index 3959d10676..4cceeeb572 100644 --- a/public/docs/dart/latest/tutorial/index.jade +++ b/public/docs/dart/latest/tutorial/index.jade @@ -2,8 +2,7 @@ include ../_util-fns +includeShared('{ts}', 'intro') -:marked - [View the source code](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-5/dart) +p Run the #[+liveExampleLink2('', 'toh-5')]. +includeShared('{ts}', 'main') diff --git a/public/docs/dart/latest/tutorial/toh-pt1.jade b/public/docs/dart/latest/tutorial/toh-pt1.jade index cb6d389286..a600cea7d6 100644 --- a/public/docs/dart/latest/tutorial/toh-pt1.jade +++ b/public/docs/dart/latest/tutorial/toh-pt1.jade @@ -34,15 +34,13 @@ include ../_util-fns .callout.is-helpful header Source code - :marked - The complete source code for the example app in this chapter is - [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-1/dart). + p Run the #[+liveExampleLink2('', 'toh-1')] for this part. :marked ## Keep the app compiling and running We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing -code-example(format="" language="bash"). +code-example(language="bash"). pub serve :marked diff --git a/public/docs/dart/latest/tutorial/toh-pt2.jade b/public/docs/dart/latest/tutorial/toh-pt2.jade index 8a6d7405f1..1c563e9100 100644 --- a/public/docs/dart/latest/tutorial/toh-pt2.jade +++ b/public/docs/dart/latest/tutorial/toh-pt2.jade @@ -12,9 +12,7 @@ include ../_util-fns .callout.is-helpful header Source code - :marked - The complete source code for the example app in this chapter is - [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-2/dart). + p Run the #[+liveExampleLink2('', 'toh-2')] for this part. .l-main-section :marked @@ -38,7 +36,7 @@ include ../_util-fns ### Keep the app compiling and running We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing -code-example(format="." language="bash"). +code-example(language="bash"). pub serve :marked diff --git a/public/docs/dart/latest/tutorial/toh-pt3.jade b/public/docs/dart/latest/tutorial/toh-pt3.jade index 63a421eb6b..3c4a961b77 100644 --- a/public/docs/dart/latest/tutorial/toh-pt3.jade +++ b/public/docs/dart/latest/tutorial/toh-pt3.jade @@ -4,8 +4,7 @@ include ../_util-fns Our app is growing. Use cases are flowing in for reusing components, passing data to components, and creating more reusable assets. Let's separate the heroes list from the hero details and make the details component reusable. - The complete source code for the example app in this chapter is - [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-3/dart). +p Run the #[+liveExampleLink2('', 'toh-3')] for this part. .l-main-section :marked diff --git a/public/docs/dart/latest/tutorial/toh-pt4.jade b/public/docs/dart/latest/tutorial/toh-pt4.jade index 238f23e06f..e84d25db18 100644 --- a/public/docs/dart/latest/tutorial/toh-pt4.jade +++ b/public/docs/dart/latest/tutorial/toh-pt4.jade @@ -15,8 +15,7 @@ include ../_util-fns Because data services are invariably asynchronous, we'll finish the chapter with a promise-based version of the data service. - The complete source code for the example app in this chapter is - [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-4/dart). +p Run the #[+liveExampleLink2('', 'toh-4')] for this part. .l-main-section :marked @@ -42,7 +41,7 @@ include ../_util-fns Open a terminal/console window. Start the Dart compiler, watch for changes, and start our server by entering the command: -code-example(format="." language="bash"). +code-example(language="bash"). pub serve :marked diff --git a/public/docs/dart/latest/tutorial/toh-pt5.jade b/public/docs/dart/latest/tutorial/toh-pt5.jade index dda232bed8..11cde4b710 100644 --- a/public/docs/dart/latest/tutorial/toh-pt5.jade +++ b/public/docs/dart/latest/tutorial/toh-pt5.jade @@ -17,9 +17,8 @@ figure.image-display :marked The [Routing and Navigation](../guide/router.html) chapter covers the router in more detail than we will in this tour. -:marked - The complete source code for the example app in this chapter is - [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-5/dart). + +p Run the #[+liveExampleLink2('', 'toh-5')] for this part. .l-main-section :marked @@ -48,7 +47,7 @@ figure.image-display Open a terminal/console window. Start the Dart compiler, watch for changes, and start our server by entering the command: -code-example(format="." language="bash"). +code-example(language="bash"). pub serve :marked diff --git a/public/docs/ts/latest/tutorial/index.jade b/public/docs/ts/latest/tutorial/index.jade index 2845fefcc3..d4a3110dcd 100644 --- a/public/docs/ts/latest/tutorial/index.jade +++ b/public/docs/ts/latest/tutorial/index.jade @@ -26,8 +26,7 @@ include ../_util-fns to chapters with greater depth. // #enddocregion intro -:marked - [Run the live example](/resources/live-examples/toh-6/ts/plnkr.html) +p Run the #[+liveExampleLink2('', 'toh-6')]. // #docregion main .l-main-section diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade index 01aba8ec94..583457cfb9 100644 --- a/public/docs/ts/latest/tutorial/toh-pt1.jade +++ b/public/docs/ts/latest/tutorial/toh-pt1.jade @@ -5,8 +5,8 @@ include ../_util-fns Every story starts somewhere. Our story starts where the [QuickStart](../quickstart.html) ends. - [Run the live example for part 1](/resources/live-examples/toh-1/ts/plnkr.html) - +p Run the #[+liveExampleLink2('', 'toh-1')] for this part. +:marked Create a folder called `angular2-tour-of-heroes` and follow the [QuickStart](../quickstart.html) steps which provide the prerequisites, the folder structure, and the core files for our Tour of Heroes. @@ -33,7 +33,7 @@ include ../_quickstart_repo ## Keep the app transpiling and running We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing -code-example(format="" language="bash"). +code-example(language="bash"). npm start :marked @@ -170,8 +170,8 @@ code-example(language="html"). using the built-in `ngModel` directive. * The `ngModel` directive also propagates changes to every other binding of the `hero.name`. - [Run the live example for part 1](/resources/live-examples/toh-1/ts/plnkr.html) - +p Run the #[+liveExampleLink2('', 'toh-1')] for this part. +:marked Here's the complete `app.component.ts` as it stands now: +makeExample('toh-1/ts/app/app.component.ts', 'pt1', 'app.component.ts') @@ -183,4 +183,4 @@ code-example(language="html"). We also want to allow the user to select a hero and display their details. We’ll learn more about how to retrieve lists, bind them to the template, and allow a user to select it in the - [next tutorial chapter](./toh-pt2.html). \ No newline at end of file + [next tutorial chapter](./toh-pt2.html). diff --git a/public/docs/ts/latest/tutorial/toh-pt2.jade b/public/docs/ts/latest/tutorial/toh-pt2.jade index 8a80596142..aced39f750 100644 --- a/public/docs/ts/latest/tutorial/toh-pt2.jade +++ b/public/docs/ts/latest/tutorial/toh-pt2.jade @@ -6,8 +6,8 @@ include ../_util-fns We’ll expand our Tour of Heroes app to display a list of heroes, allow the user to select a hero, and display the hero’s details. - [Run the live example for part 2](/resources/live-examples/toh-2/ts/plnkr.html) - +p Run the #[+liveExampleLink2('', 'toh-2')] for this part. +:marked Let’s take stock of what we’ll need to display a list of heroes. First, we need a list of heroes. We want to display those heroes in the view’s template, so we’ll need a way to do that. @@ -38,7 +38,7 @@ include ../_util-fns ### Keep the app transpiling and running We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing -code-example(format="." language="bash"). +code-example(language="bash"). npm start :marked @@ -301,8 +301,8 @@ code-example(format="." language="bash"). * We added the ability to select a hero and show the hero’s details * We learned how to use the built-in directives `ngIf` and `ngFor` in a component’s template - [Run the live example for part 2](/resources/live-examples/toh-2/ts/plnkr.html) - +p Run the #[+liveExampleLink2('', 'toh-2')] for this part. +:marked ### The Road Ahead Our Tour of Heroes has grown, but it’s far from complete. We can't put the entire app into a single component. diff --git a/public/docs/ts/latest/tutorial/toh-pt3.jade b/public/docs/ts/latest/tutorial/toh-pt3.jade index 5188a609d0..e5cb933aa6 100644 --- a/public/docs/ts/latest/tutorial/toh-pt3.jade +++ b/public/docs/ts/latest/tutorial/toh-pt3.jade @@ -4,7 +4,7 @@ include ../_util-fns Our app is growing. Use cases are flowing in for reusing components, passing data to components, and creating more reusable assets. Let's separate the heroes list from the hero details and make the details component reusable. - [Run the live example for part 3](/resources/live-examples/toh-3/ts/plnkr.html) +p Run the #[+liveExampleLink2('', 'toh-3')] for this part. .l-main-section :marked @@ -242,7 +242,7 @@ code-example(format=".") * We learned to bind a parent component to a child component. * We learned to declare the application directives we need in a `directives` array. - [Run the live example for part 3](/resources/live-examples/toh-3/ts/plnkr.html). +p Run the #[+liveExampleLink2('', 'toh-3')] for this part. .l-main-section :marked diff --git a/public/docs/ts/latest/tutorial/toh-pt4.jade b/public/docs/ts/latest/tutorial/toh-pt4.jade index 630007aacd..123b711eb0 100644 --- a/public/docs/ts/latest/tutorial/toh-pt4.jade +++ b/public/docs/ts/latest/tutorial/toh-pt4.jade @@ -15,8 +15,7 @@ include ../_util-fns Because data services are invariably asynchronous, we'll finish the chapter with a promise-based version of the data service. -:marked - [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html) +p Run the #[+liveExampleLink2('', 'toh-4')] for this part. .l-main-section :marked @@ -41,12 +40,13 @@ include ../_util-fns .file systemjs.config.js .file tsconfig.json .file typings.json + :marked ### Keep the app transpiling and running Open a terminal/console window. Start the TypeScript compiler, watch for changes, and start our server by entering the command: -code-example(format="." language="bash"). +code-example(language="bash"). npm start :marked @@ -340,8 +340,8 @@ a#child-component * We created mock hero data and imported them into our service * We designed our service to return a promise and our component to get our data from the promise - [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html) - +p Run the #[+liveExampleLink2('', 'toh-4')] for this part. +:marked ### The Road Ahead Our Tour of Heroes has become more reusable using shared components and services. We want to create a dashboard, add menu links that route between the views, and format data in a template. diff --git a/public/docs/ts/latest/tutorial/toh-pt5.jade b/public/docs/ts/latest/tutorial/toh-pt5.jade index 79d61f7211..74033d91d3 100644 --- a/public/docs/ts/latest/tutorial/toh-pt5.jade +++ b/public/docs/ts/latest/tutorial/toh-pt5.jade @@ -17,8 +17,9 @@ figure.image-display :marked The [Routing and Navigation](../guide/router-deprecated.html) chapter covers the router in more detail than we will in this tour. -:marked - [Run the live example](/resources/live-examples/toh-5/ts/plnkr.html). + +p Run the #[+liveExampleLink2('', 'toh-5')] for this part. + .l-sub-section img(src='/resources/images/devguide/plunker-separate-window-button.png' alt="pop out the window" align="right" style="margin-right:-20px") :marked @@ -55,7 +56,7 @@ figure.image-display Open a terminal/console window and enter the following command to start the TypeScript compiler, start the server, and watch for changes: -code-example(format="." language="bash"). +code-example(language="bash"). npm start :marked @@ -646,10 +647,11 @@ figure.image-display .l-main-section :marked ## Application structure and code - - Review the sample source code [in the live example for this chapter](/resources/live-examples/toh-5/ts/plnkr.html). +p. + Review the sample source code in the #[+liveExampleLink2('', 'toh-5')] for this part. Verify that we have the following structure: +:marked .filetree .file angular2-tour-of-heroes .children diff --git a/public/docs/ts/latest/tutorial/toh-pt6.jade b/public/docs/ts/latest/tutorial/toh-pt6.jade index 06f07ade49..7098025b0a 100644 --- a/public/docs/ts/latest/tutorial/toh-pt6.jade +++ b/public/docs/ts/latest/tutorial/toh-pt6.jade @@ -8,8 +8,8 @@ include ../_util-fns and save these changes back to the server. In this chapter we teach our application to make the corresponding http calls to a remote server's web api. -:marked - [Run the live example](/resources/live-examples/toh-6/ts/plnkr.html). + +p Run the #[+liveExampleLink2('', 'toh-6')] for this part. .l-main-section :marked @@ -21,7 +21,7 @@ include ../_util-fns Open a terminal/console window and enter the following command to start the TypeScript compiler, start the server, and watch for changes: -code-example(format="." language="bash"). +code-example(language="bash"). npm start :marked From f3205f5beb64777c04df5af0e018b64400a496e1 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 8 Jun 2016 01:06:25 +0200 Subject: [PATCH 0005/1217] chore: first sweep on linting the codebase closes #1616 --- gulpfile.js | 10 +++- package.json | 2 +- .../architecture/ts/app/backend.service.ts | 2 +- .../ts/app/hero-detail.component.ts | 2 +- .../ts/app/sales-tax.component.ts | 2 +- .../architecture/ts/app/sales-tax.service.ts | 8 +-- .../architecture/ts/app/tax-rate.service.ts | 2 +- .../ts/app/app.component.ts | 2 +- .../ts/app/highlight.directive.2.ts | 4 +- .../ts/app/highlight.directive.ts | 6 +-- .../cb-a1-a2-quick-reference/e2e-spec.ts | 6 +-- .../ts/app/movie-list.component.ts | 2 +- .../cb-component-communication/e2e-spec.ts | 14 ++--- .../ts/app/app.component.ts | 2 +- .../ts/app/astronaut.component.ts | 12 ++--- .../ts/app/countdown-parent.component.ts | 10 ++-- .../ts/app/countdown-timer.component.ts | 2 +- .../cb-component-communication/ts/app/hero.ts | 2 +- .../cb-component-communication/ts/app/main.ts | 2 +- .../ts/app/mission.service.ts | 4 +- .../ts/app/missioncontrol.component.ts | 4 +- .../ts/app/version-child.component.ts | 2 +- .../ts/app/voter.component.ts | 4 +- .../ts/app/votetaker.component.ts | 2 +- .../cb-component-relative-paths/e2e-spec.ts | 2 +- .../ts/app/app.component.ts | 2 +- .../cb-dependency-injection/e2e-spec.ts | 2 +- .../ts/app/app.component.ts | 2 +- .../ts/app/hero-bio.component.ts | 8 +-- .../ts/app/hero-bios.component.ts | 18 +++---- .../ts/app/hero-cache.service.ts | 8 +-- .../ts/app/hero-contact.component.ts | 6 +-- .../ts/app/hero-data.ts | 8 +-- .../ts/app/hero.service.ts | 14 ++--- .../cb-dependency-injection/ts/app/hero.ts | 10 ++-- .../ts/app/parent-finder.component.ts | 4 +- .../ts/app/user-context.service.ts | 10 ++-- .../ts/app/user.service.ts | 4 +- .../_examples/cb-dynamic-form/e2e-spec.ts | 2 +- .../cb-dynamic-form/ts/app/app.component.ts | 4 +- .../ts/app/dynamic-form-question.component.ts | 8 +-- .../ts/app/dynamic-form.component.ts | 6 +-- .../_examples/cb-dynamic-form/ts/app/main.ts | 2 +- .../cb-dynamic-form/ts/app/question-base.ts | 28 +++++----- .../ts/app/question-control.service.ts | 4 +- .../ts/app/question-dropdown.ts | 6 +-- .../ts/app/question-textbox.ts | 6 +-- .../ts/app/question.service.ts | 24 ++++----- .../cb-set-document-title/ts/app/main.ts | 1 + .../hero-di-inject-additional.component.ts | 6 +-- .../ts/app/hero-di-inject.component.ts | 2 +- .../cb-ts-to-js/ts/app/hero-di.component.ts | 4 +- .../cb-ts-to-js/ts/app/hero-io.component.ts | 8 +-- .../ts/app/hero-lifecycle.component.ts | 2 +- .../cb-ts-to-js/ts/app/hero.component.ts | 4 +- .../ts/app/heroes-bindings.component.ts | 6 +-- .../ts/app/heroes-queries.component.ts | 10 ++-- .../docs/_examples/cb-ts-to-js/ts/app/main.ts | 2 - .../ts/app/hero-app.component.ts | 2 +- .../_examples/component-styles/ts/app/hero.ts | 6 +-- .../dependency-injection/e2e-spec.ts | 6 +-- .../ts/app/app.component.1.ts | 2 +- .../ts/app/app.component.2.ts | 6 +-- .../ts/app/app.component.ts | 10 ++-- .../dependency-injection/ts/app/app.config.ts | 6 +-- .../ts/app/car/car-creations.ts | 30 +++++------ .../ts/app/car/car-injector.ts | 10 ++-- .../ts/app/car/car-no-di.ts | 10 ++-- .../dependency-injection/ts/app/car/car.ts | 4 +- .../ts/app/heroes/hero-list.component.ts | 1 + .../ts/app/heroes/hero.service.2.ts | 6 +-- .../ts/app/heroes/hero.service.provider.ts | 3 +- .../ts/app/heroes/hero.service.ts | 4 +- .../ts/app/heroes/heroes.component.1.ts | 4 +- .../ts/app/heroes/heroes.component.ts | 6 +-- .../ts/app/heroes/mock-heroes.ts | 20 +++---- .../ts/app/injector.component.ts | 6 +-- .../ts/app/logger.service.ts | 2 +- .../dependency-injection/ts/app/main.1.ts | 5 +- .../dependency-injection/ts/app/main.ts | 4 +- .../ts/app/providers.component.ts | 3 +- .../ts/app/test.component.ts | 25 ++++----- .../ts/app/user.service.ts | 6 +-- .../ts/app/app-ctor.component.ts | 2 +- .../displaying-data/ts/app/app.component.3.ts | 4 +- .../_examples/displaying-data/ts/app/hero.ts | 6 +-- .../displaying-data/ts/app/main.1.ts | 7 +-- .../_examples/forms/ts/app/app.component.ts | 2 +- .../forms/ts/app/hero-form.component.ts | 4 +- .../e2e-spec.ts | 16 +++--- .../ts/app/edit-item.ts | 2 +- .../ts/app/heroes.service.ts | 4 +- .../ts/app/main.ts | 2 +- .../ts/app/restore.service.ts | 6 +-- .../homepage-hello-world/e2e-spec.ts | 2 +- .../_examples/homepage-todo/ts/app/todo.ts | 4 +- .../homepage-todo/ts/app/todo_app.ts | 2 +- .../homepage-todo/ts/app/todo_form.ts | 2 +- .../homepage-todo/ts/app/todo_list.ts | 1 + .../_examples/lifecycle-hooks/e2e-spec.ts | 54 +++++++++---------- .../ts/app/after-content.component.ts | 4 +- .../ts/app/after-view.component.ts | 16 +++--- .../ts/app/peek-a-boo.component.ts | 4 +- .../lifecycle-hooks/ts/app/spy.directive.ts | 4 +- public/docs/_examples/pipes/e2e-spec.ts | 43 ++++++++------- .../_examples/pipes/ts/app/app.component.ts | 6 +-- .../_examples/pipes/ts/app/fetch-json.pipe.ts | 2 +- .../pipes/ts/app/flying-heroes.component.ts | 6 +-- .../pipes/ts/app/flying-heroes.pipe.ts | 2 +- .../ts/app/hero-async-message.component.ts | 14 ++--- .../pipes/ts/app/hero-birthday1.component.ts | 4 +- .../pipes/ts/app/hero-birthday2.component.ts | 6 +-- public/docs/_examples/pipes/ts/app/heroes.ts | 12 ++--- .../_examples/router-deprecated/e2e-spec.ts | 20 +++---- .../app/crisis-center/add-crisis.component.ts | 2 +- .../crisis-center.component.1.ts | 4 +- .../crisis-center/crisis-center.component.ts | 4 +- .../crisis-detail.component.1.ts | 2 +- .../crisis-center/crisis-detail.component.ts | 2 +- .../ts/app/crisis-center/crisis.service.ts | 9 ++-- .../ts/app/dialog.service.ts | 2 +- .../ts/app/heroes/hero-detail.component.1.ts | 6 +-- .../ts/app/heroes/hero-detail.component.ts | 6 +-- .../ts/app/heroes/hero-list.component.1.ts | 4 +- .../ts/app/heroes/hero-list.component.ts | 2 +- .../ts/app/heroes/hero.service.ts | 16 +++--- .../router-deprecated/ts/app/main.1.ts | 2 +- public/docs/_examples/router/e2e-spec.ts | 20 +++---- .../ts/app/heroes/hero-detail.component.ts | 2 +- .../ts/app/heroes/hero-list.component.1.ts | 8 +-- .../ts/app/heroes/hero-list.component.ts | 2 +- .../router/ts/app/heroes/hero.service.ts | 2 +- public/docs/_examples/router/ts/app/main.2.ts | 2 +- .../server-communication/e2e-spec.ts | 10 ++-- .../ts/app/toh/hero-list.component.promise.ts | 5 +- .../ts/app/toh/hero-list.component.ts | 5 +- .../ts/app/toh/hero.service.promise.ts | 4 +- .../ts/app/wiki/wiki.component.ts | 3 +- .../ts/app/wiki/wikipedia.service.1.ts | 2 +- .../structural-directives/e2e-spec.ts | 4 +- .../ts/app/heavy-loader.component.ts | 4 +- .../ts/app/structural-directives.component.ts | 4 +- .../style-guide/ts/01-01/app/index.ts | 2 +- .../style-guide/ts/02-07/app/index.ts | 2 +- .../style-guide/ts/02-08/app/index.ts | 2 +- .../style-guide/ts/03-01/app/index.ts | 2 +- .../style-guide/ts/03-02/app/index.ts | 2 +- .../style-guide/ts/03-03/app/index.ts | 2 +- .../style-guide/ts/03-04/app/index.ts | 2 +- .../style-guide/ts/03-05/app/index.ts | 2 +- .../style-guide/ts/03-06/app/index.ts | 2 +- .../style-guide/ts/04-10/app/index.ts | 2 +- .../app/shared/spinner/spinner.component.ts | 2 +- .../style-guide/ts/04-14/app/index.ts | 2 +- .../style-guide/ts/05-02/app/index.ts | 2 +- .../style-guide/ts/05-03/app/index.ts | 2 +- .../style-guide/ts/05-04/app/index.ts | 2 +- .../style-guide/ts/05-12/app/index.ts | 2 +- .../style-guide/ts/05-13/app/index.ts | 2 +- .../style-guide/ts/05-14/app/index.ts | 2 +- .../style-guide/ts/05-15/app/index.ts | 2 +- .../style-guide/ts/05-16/app/index.ts | 2 +- .../style-guide/ts/05-17/app/index.ts | 2 +- .../style-guide/ts/06-01/app/index.ts | 2 +- .../style-guide/ts/06-03/app/index.ts | 2 +- .../style-guide/ts/07-01/app/index.ts | 2 +- .../style-guide/ts/07-03/app/index.ts | 2 +- .../style-guide/ts/07-04/app/app.component.ts | 4 +- .../style-guide/ts/07-04/app/index.ts | 2 +- .../style-guide/ts/09-01/app/index.ts | 2 +- .../style-guide/ts/10-01/app/index.ts | 2 +- .../_examples/template-syntax/e2e-spec.ts | 4 +- .../ts/app/decorator.directive.ts | 6 +-- .../ts/app/hero-detail.component.ts | 15 +++--- .../_examples/template-syntax/ts/app/hero.ts | 40 +++++++------- .../_examples/template-syntax/ts/app/main.ts | 2 +- .../ts/app/my-click.directive.ts | 19 +++---- .../testing/ts/app/app.component.spec.ts | 2 +- .../docs/_examples/testing/ts/app/bag.spec.ts | 2 +- public/docs/_examples/testing/ts/app/bag.ts | 2 +- .../_examples/testing/ts/app/expect-proper.ts | 2 +- .../testing/ts/app/hero-detail.component.ts | 1 + .../_examples/testing/ts/app/hero.service.ts | 8 +-- .../testing/ts/app/http-hero.service.ts | 14 ++--- .../_examples/testing/ts/app/mock-router.ts | 1 + .../_examples/toh-1/ts/app/app.component.ts | 2 +- .../_examples/toh-2/ts/app/app.component.ts | 26 ++++----- .../_examples/toh-3/ts/app/app.component.ts | 28 +++++----- .../toh-3/ts/app/hero-detail.component.ts | 8 +-- .../_examples/toh-4/ts/app/app.component.1.ts | 2 +- .../_examples/toh-4/ts/app/app.component.ts | 2 +- .../_examples/toh-4/ts/app/hero.service.ts | 2 +- public/docs/_examples/toh-5/e2e-spec.ts | 12 ++--- .../toh-5/ts/app/dashboard.component.2.ts | 4 +- .../toh-5/ts/app/dashboard.component.ts | 4 +- .../_examples/toh-5/ts/app/hero.service.ts | 8 +-- public/docs/_examples/toh-6/e2e-spec.ts | 2 +- .../toh-6/ts/app/dashboard.component.ts | 2 +- .../ts/app/1-2-hybrid-bootstrap/app.module.ts | 2 +- .../app.module.ts | 2 +- .../ts/app/1-bootstrap/app.module.ts | 2 +- .../ts/app/1-ng-app/app.module.ts | 2 +- .../ts/app/1-to-2-projection/app.module.ts | 2 +- .../ts/app/1-to-2-providers/app.module.ts | 2 +- .../1-to-2-providers/hero-detail.component.ts | 4 +- .../ts/app/2-to-1-providers/app.module.ts | 4 +- .../2-to-1-providers/hero-detail.component.ts | 2 +- .../ts/app/2-to-1-transclusion/app.module.ts | 4 +- .../app/downgrade-io/hero-detail.component.ts | 4 +- .../ts/app/downgrade-io/main.controller.ts | 4 +- .../ts/app/hero-detail.directive.ts | 2 +- .../_examples/upgrade-adapter/ts/app/hero.ts | 6 +-- .../ts/app/upgrade-io/app.module.ts | 2 +- .../ts/app/upgrade-io/container.component.ts | 2 +- .../ts/app/upgrade-static/app.module.ts | 2 +- .../ts/app/app.animations.ts | 8 +-- .../ts/app/app.config.ts | 2 +- .../ts/app/core/phone/phone.service.spec.ts | 8 +-- .../phone-detail.component.spec.ts | 2 +- .../ts/app/app.animations.ts | 8 +-- .../ts/app/app.config.ts | 4 +- .../ts/app/core/phone/phone.service.spec.ts | 8 +-- .../phone-detail.component.spec.ts | 6 +-- .../phone-detail/phone-detail.component.ts | 2 +- .../phone-list/phone-list.component.spec.ts | 4 +- .../ts/app/phone-list/phone-list.component.ts | 4 +- .../ts/app/app.component.ts | 6 +-- .../ts/app/core/phone/phone.service.spec.ts | 8 +-- .../phone-detail.component.spec.ts | 6 +-- .../phone-detail/phone-detail.component.ts | 2 +- .../phone-list/phone-list.component.spec.ts | 6 +-- .../ts/app/phone-list/phone-list.component.ts | 4 +- public/docs/_examples/user-input/e2e-spec.ts | 12 ++--- .../user-input/ts/app/click-me.component.ts | 4 +- .../user-input/ts/app/click-me2.component.ts | 6 +-- .../user-input/ts/app/keyup.components.ts | 13 ++--- .../ts/app/little-tour.component.ts | 4 +- .../user-input/ts/app/loop-back.component.ts | 2 +- tslint.json | 3 +- 239 files changed, 701 insertions(+), 688 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 59e7749515..a8e7e67e04 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -636,7 +636,15 @@ gulp.task('_zip-examples', function() { // Linting gulp.task('lint', function() { - return gulp.src(['./public/docs/_examples/style-guide/ts/**/*.ts', '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts']) + return gulp.src([ + './public/docs/_examples/**/*.ts', + '!./public/docs/_examples/**/ts-snippets/*.ts', + '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts', + '!./public/docs/_examples/**/node_modules/**/*', + '!./public/docs/_examples/_protractor/**/*', + '!./public/docs/_examples/**/typings/**/*', + '!./public/docs/_examples/**/typings-ng1/**/*' + ]) .pipe(tslint({ rulesDirectory: ['node_modules/codelyzer'], configuration: require('./tslint.json') diff --git a/package.json b/package.json index dcc67e9351..2645f4a367 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "browser-sync": "^2.9.3", "canonical-path": "0.0.2", "cross-spawn": "^4.0.0", - "codelyzer": "0.0.20", + "codelyzer": "0.0.22", "del": "^2.2.0", "dgeni": "^0.4.0", "dgeni-packages": "^0.13.0", diff --git a/public/docs/_examples/architecture/ts/app/backend.service.ts b/public/docs/_examples/architecture/ts/app/backend.service.ts index 907a40696e..a49de94fde 100644 --- a/public/docs/_examples/architecture/ts/app/backend.service.ts +++ b/public/docs/_examples/architecture/ts/app/backend.service.ts @@ -13,7 +13,7 @@ const HEROES = [ export class BackendService { constructor(private logger: Logger) {} - getAll(type:Type) : PromiseLike{ + getAll(type: Type): PromiseLike { if (type === Hero) { // TODO get from the database return Promise.resolve(HEROES); diff --git a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts index 579ef637b0..fc2604e53e 100644 --- a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts @@ -1,4 +1,4 @@ -import { Component, Input} from '@angular/core'; +import { Component, Input } from '@angular/core'; import { Hero } from './hero'; diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts index 6d0c668578..252f8e5b14 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts @@ -35,7 +35,7 @@ export class SalesTaxComponent { constructor(private salesTaxService: SalesTaxService) { } // #enddocregion ctor - getTax(value:string | number){ + getTax(value: string | number) { return this.salesTaxService.getVAT(value); } } diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts index 813cb4c9c0..f0d5457342 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts @@ -1,5 +1,5 @@ // #docregion -import { Inject, Injectable } from '@angular/core'; +import { Inject, Injectable } from '@angular/core'; import { TaxRateService } from './tax-rate.service'; @@ -7,9 +7,9 @@ import { TaxRateService } from './tax-rate.service'; @Injectable() export class SalesTaxService { constructor(private rateService: TaxRateService) { } - getVAT(value:string | number){ - let amount:number; - if (typeof value === "string"){ + getVAT(value: string | number) { + let amount: number; + if (typeof value === 'string') { amount = parseFloat(value); } else { amount = value; diff --git a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts index baaa8f49c7..334399f27a 100644 --- a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts +++ b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts @@ -4,6 +4,6 @@ import { Injectable } from '@angular/core'; // #docregion class @Injectable() export class TaxRateService { - getRate(rateName:string){return 0.10;} // always 10% everywhere + getRate(rateName: string) {return 0.10; } // always 10% everywhere } // #enddocregion class diff --git a/public/docs/_examples/attribute-directives/ts/app/app.component.ts b/public/docs/_examples/attribute-directives/ts/app/app.component.ts index 15167310c6..711e98f1e2 100644 --- a/public/docs/_examples/attribute-directives/ts/app/app.component.ts +++ b/public/docs/_examples/attribute-directives/ts/app/app.component.ts @@ -11,4 +11,4 @@ import { HighlightDirective } from './highlight.directive'; export class AppComponent { } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts index 8e64391f05..d6b295fae2 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts @@ -14,12 +14,12 @@ import { Directive, ElementRef, Input } from '@angular/core'; export class HighlightDirective { // #docregion ctor - private el:HTMLElement; + private el: HTMLElement; constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion ctor // #docregion mouse-methods - onMouseEnter() { this.highlight("yellow"); } + onMouseEnter() { this.highlight('yellow'); } onMouseLeave() { this.highlight(null); } private highlight(color: string) { diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts index 6ec9842602..09a762a892 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts @@ -13,12 +13,12 @@ import { Directive, ElementRef, Input } from '@angular/core'; export class HighlightDirective { private _defaultColor = 'red'; private el: HTMLElement; - + constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion class-1 // #docregion defaultColor - @Input() set defaultColor(colorName:string){ + @Input() set defaultColor(colorName: string){ this._defaultColor = colorName || this._defaultColor; } // #enddocregion defaultColor @@ -33,7 +33,7 @@ export class HighlightDirective { // #enddocregion mouse-enter onMouseLeave() { this.highlight(null); } - private highlight(color:string) { + private highlight(color: string) { this.el.style.backgroundColor = color; } } diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts index f75a17ee6e..d0e4bdc850 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts @@ -85,7 +85,7 @@ describe('Angular 1 to 2 Quick Reference Tests', function () { posterButton.click().then(function () { testImagesAreDisplayed(isDisplayed); - }) + }); } function getMovieRows() { @@ -107,7 +107,7 @@ describe('Angular 1 to 2 Quick Reference Tests', function () { } else { expect(favoriteHeroLabel.isDisplayed()).toBe(false); } - }) - }) + }); + }); } }); diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts index 99f0699410..286615b95c 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts @@ -11,7 +11,7 @@ import { StringSafeDatePipe } from './date.pipe'; // #docregion component @Component({ selector: 'movie-list', - templateUrl:'app/movie-list.component.html', + templateUrl: 'app/movie-list.component.html', // #enddocregion component // #docregion style-url styleUrls: ['app/movie-list.component.css'], diff --git a/public/docs/_examples/cb-component-communication/e2e-spec.ts b/public/docs/_examples/cb-component-communication/e2e-spec.ts index fc2566662d..8566805c99 100644 --- a/public/docs/_examples/cb-component-communication/e2e-spec.ts +++ b/public/docs/_examples/cb-component-communication/e2e-spec.ts @@ -20,8 +20,8 @@ describe('Component Communication Cookbook Tests', function () { for (let i = 0; i < _heroNames.length; i++) { let childTitle = heroes.get(i).element(by.tagName('h3')).getText(); let childDetail = heroes.get(i).element(by.tagName('p')).getText(); - expect(childTitle).toEqual(_heroNames[i] + ' says:') - expect(childDetail).toContain(_masterName) + expect(childTitle).toEqual(_heroNames[i] + ' says:'); + expect(childDetail).toContain(_masterName); } }); // ... @@ -38,7 +38,7 @@ describe('Component Communication Cookbook Tests', function () { let hero = parent.all(by.tagName('name-child')).get(_nonEmptyNameIndex); let displayName = hero.element(by.tagName('h3')).getText(); - expect(displayName).toEqual(_nonEmptyName) + expect(displayName).toEqual(_nonEmptyName); }); it('should replace empty name with default name', function () { @@ -48,7 +48,7 @@ describe('Component Communication Cookbook Tests', function () { let hero = parent.all(by.tagName('name-child')).get(_emptyNameIndex); let displayName = hero.element(by.tagName('h3')).getText(); - expect(displayName).toEqual(_defaultName) + expect(displayName).toEqual(_defaultName); }); // ... // #enddocregion parent-to-child-setter @@ -83,7 +83,7 @@ describe('Component Communication Cookbook Tests', function () { expect(actual.label).toBe(labelAfter2Minor); expect(actual.count).toBe(3); expect(actual.logs.get(2).getText()).toBe(logAfter2Minor); - }) + }); }); }); @@ -155,11 +155,11 @@ describe('Component Communication Cookbook Tests', function () { // Can't run timer tests in protractor because // interaction w/ zones causes all tests to freeze & timeout. xdescribe('Parent calls child via local var', function() { - countDownTimerTests('countdown-parent-lv') + countDownTimerTests('countdown-parent-lv'); }); xdescribe('Parent calls ViewChild', function() { - countDownTimerTests('countdown-parent-vc') + countDownTimerTests('countdown-parent-vc'); }); function countDownTimerTests(parentTag: string) { diff --git a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts index 5b2442b195..332d8f7f0f 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts @@ -19,7 +19,7 @@ let directives: any[] = [ // Include Countdown examples // unless in e2e tests which they break. if (!/e2e/.test(location.search)) { - console.log('adding countdown timer examples') + console.log('adding countdown timer examples'); directives.push(CountdownLocalVarParentComponent); directives.push(CountdownViewChildParentComponent); } diff --git a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts index 7bda2b100f..bc24964f86 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts @@ -17,12 +17,12 @@ import { Subscription } from 'rxjs/Subscription';

` }) -export class AstronautComponent implements OnDestroy{ +export class AstronautComponent implements OnDestroy { @Input() astronaut: string; - mission = ""; + mission = ''; confirmed = false; announced = false; - subscription:Subscription; + subscription: Subscription; constructor(private missionService: MissionService) { this.subscription = missionService.missionAnnounced$.subscribe( @@ -30,7 +30,7 @@ export class AstronautComponent implements OnDestroy{ this.mission = mission; this.announced = true; this.confirmed = false; - }) + }); } confirm() { @@ -38,9 +38,9 @@ export class AstronautComponent implements OnDestroy{ this.missionService.confirmMission(this.astronaut); } - ngOnDestroy(){ + ngOnDestroy() { // prevent memory leak when component destroyed this.subscription.unsubscribe(); } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts index 95425deef2..a89dee52d9 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts @@ -11,7 +11,7 @@ import { CountdownTimerComponent } from './countdown-timer.component'; //// Local variable, #timer, version // #docregion lv @Component({ - selector:'countdown-parent-lv', + selector: 'countdown-parent-lv', template: `

Countdown to Liftoff (via local variable)

@@ -28,7 +28,7 @@ export class CountdownLocalVarParentComponent { } //// View Child version // #docregion vc @Component({ - selector:'countdown-parent-vc', + selector: 'countdown-parent-vc', template: `

Countdown to Liftoff (via ViewChild)

@@ -42,7 +42,7 @@ export class CountdownLocalVarParentComponent { } export class CountdownViewChildParentComponent implements AfterViewInit { @ViewChild(CountdownTimerComponent) - private timerComponent:CountdownTimerComponent; + private timerComponent: CountdownTimerComponent; seconds() { return 0; } @@ -50,10 +50,10 @@ export class CountdownViewChildParentComponent implements AfterViewInit { // Redefine `seconds()` to get from the `CountdownTimerComponent.seconds` ... // but wait a tick first to avoid one-time devMode // unidirectional-data-flow-violation error - setTimeout(() => this.seconds = () => this.timerComponent.seconds, 0) + setTimeout(() => this.seconds = () => this.timerComponent.seconds, 0); } - start(){ this.timerComponent.start(); } + start() { this.timerComponent.start(); } stop() { this.timerComponent.stop(); } } // #enddocregion vc diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts index 262ed6f832..a9a1a2fa7c 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts @@ -11,7 +11,7 @@ export class CountdownTimerComponent implements OnInit, OnDestroy { message = ''; seconds = 11; - clearTimer() {clearInterval(this.intervalId);} + clearTimer() { clearInterval(this.intervalId); } ngOnInit() { this.start(); } ngOnDestroy() { this.clearTimer(); } diff --git a/public/docs/_examples/cb-component-communication/ts/app/hero.ts b/public/docs/_examples/cb-component-communication/ts/app/hero.ts index 16ce60d8ed..a7b70f48e8 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/hero.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/hero.ts @@ -6,4 +6,4 @@ export const HEROES = [ {name: 'Mr. IQ'}, {name: 'Magneta'}, {name: 'Bombasto'} -]; \ No newline at end of file +]; diff --git a/public/docs/_examples/cb-component-communication/ts/app/main.ts b/public/docs/_examples/cb-component-communication/ts/app/main.ts index 9451f9b495..ad256f0823 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/main.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/main.ts @@ -2,4 +2,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; -bootstrap(AppComponent); \ No newline at end of file +bootstrap(AppComponent); diff --git a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts index 0c284389b6..25c86866b0 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts @@ -1,5 +1,5 @@ // #docregion -import { Injectable } from '@angular/core' +import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() @@ -15,7 +15,7 @@ export class MissionService { // Service message commands announceMission(mission: string) { - this.missionAnnouncedSource.next(mission) + this.missionAnnouncedSource.next(mission); } confirmMission(astronaut: string) { diff --git a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts index eff2b229c9..1c7968bb88 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts @@ -21,7 +21,7 @@ import { MissionService } from './mission.service'; providers: [MissionService] }) export class MissionControlComponent { - astronauts = ['Lovell', 'Swigert', 'Haise'] + astronauts = ['Lovell', 'Swigert', 'Haise']; history: string[] = []; missions = ['Fly to the moon!', 'Fly to mars!', @@ -32,7 +32,7 @@ export class MissionControlComponent { missionService.missionConfirmed$.subscribe( astronaut => { this.history.push(`${astronaut} confirmed the mission`); - }) + }); } announce() { diff --git a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts index 91f5d547f7..72bc07ddb3 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts @@ -17,7 +17,7 @@ export class VersionChildComponent implements OnChanges { @Input() minor: number; changeLog: string[] = []; - ngOnChanges(changes: {[propKey:string]: SimpleChange}){ + ngOnChanges(changes: {[propKey: string]: SimpleChange}) { let log: string[] = []; for (let propName in changes) { let changedProp = changes[propName]; diff --git a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts index c68409a73a..c0cb23abc0 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts @@ -14,9 +14,9 @@ export class VoterComponent { @Output() onVoted = new EventEmitter(); voted = false; - vote(agreed:boolean){ + vote(agreed: boolean) { this.onVoted.emit(agreed); this.voted = true; } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts index 3e2970b691..7267185ff1 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts @@ -18,7 +18,7 @@ import { VoterComponent } from './voter.component'; export class VoteTakerComponent { agreed = 0; disagreed = 0; - voters = ['Mr. IQ', 'Ms. Universe', 'Bombasto'] + voters = ['Mr. IQ', 'Ms. Universe', 'Bombasto']; onVoted(agreed: boolean) { agreed ? this.agreed++ : this.disagreed++; diff --git a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts index e39dfdb8a9..e15e664ca4 100644 --- a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts +++ b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts @@ -12,7 +12,7 @@ describe('Cookbook: component-relative paths', function () { title: element( by.tagName( 'h1' )), absComp: element( by.css( 'absolute-path div' ) ), relComp: element( by.css( 'relative-path div' ) ) - } + }; } let page: Page; diff --git a/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts b/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts index 09ccc94591..7ad076d1a1 100644 --- a/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { SomeAbsoluteComponent, SomeRelativeComponent} from './some.component'; +import { SomeAbsoluteComponent, SomeRelativeComponent } from './some.component'; @Component({ selector: 'my-app', diff --git a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts index 29a8822110..51ae8c485d 100644 --- a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts @@ -66,7 +66,7 @@ describe('Dependency Injection Cookbook', function () { }); it('should highlight Hero Bios and Contacts container when mouseover', function () { - let target = element(by.css('div[myHighlight="yellow"]')) + let target = element(by.css('div[myHighlight="yellow"]')); let yellow = 'rgba(255, 255, 0, 1)'; expect(target.getCssValue('background-color')).not.toEqual(yellow); diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts index a72af9e6da..578fb06730 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { HeroBiosComponent, - HeroBiosAndContactsComponent} from './hero-bios.component'; + HeroBiosAndContactsComponent } from './hero-bios.component'; import { HeroOfTheMonthComponent } from './hero-of-the-month.component'; import { HeroesBaseComponent, SortedHeroesComponent } from './sorted-heroes.component'; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts index b4d122bfe4..d1e44ae1b2 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts @@ -6,9 +6,9 @@ import { HeroCacheService } from './hero-cache.service'; // #docregion component @Component({ - selector:'hero-bio', + selector: 'hero-bio', // #docregion template - template:` + template: `

{{hero.name}}

`, @@ -18,9 +18,9 @@ import { HeroCacheService } from './hero-cache.service'; export class HeroBioComponent implements OnInit { - @Input() heroId:number; + @Input() heroId: number; - constructor(private heroCache:HeroCacheService) { } + constructor(private heroCache: HeroCacheService) { } ngOnInit() { this.heroCache.fetchCachedHero(this.heroId); } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts index 05610bb9c9..5ce00bba1a 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts @@ -10,15 +10,15 @@ import { LoggerService } from './logger.service'; //////// HeroBiosComponent //// // #docregion simple @Component({ - selector:'hero-bios', - template:` + selector: 'hero-bios', + template: ` `, - directives:[HeroBioComponent], + directives: [HeroBioComponent], providers: [HeroService] }) -export class HeroBiosComponent{ +export class HeroBiosComponent { // #enddocregion simple // #docregion ctor constructor(logger: LoggerService) { @@ -32,21 +32,21 @@ export class HeroBiosComponent{ //////// HeroBiosAndContactsComponent //// // #docregion hero-bios-and-contacts @Component({ - selector:'hero-bios-and-contacts', + selector: 'hero-bios-and-contacts', // #docregion template - template:` + template: ` `, // #enddocregion template - directives:[HeroBioComponent, HeroContactComponent], + directives: [HeroBioComponent, HeroContactComponent], // #docregion class-provider providers: [HeroService] // #enddocregion class-provider }) -export class HeroBiosAndContactsComponent{ +export class HeroBiosAndContactsComponent { constructor(logger: LoggerService) { logger.logInfo('Creating HeroBiosAndContactsComponent'); } } -// #enddocregion hero-bios-and-contacts \ No newline at end of file +// #enddocregion hero-bios-and-contacts diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts index c8e6104666..6dbc7a0c4f 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts @@ -7,14 +7,14 @@ import { HeroService } from './hero.service'; // #docregion service @Injectable() export class HeroCacheService { - hero:Hero; - constructor(private heroService:HeroService){} + hero: Hero; + constructor(private heroService: HeroService) {} - fetchCachedHero(id:number){ + fetchCachedHero(id: number) { if (!this.hero) { this.hero = this.heroService.getHeroById(id); } - return this.hero + return this.hero; } } // #enddocregion service diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts index a91f01b104..a2cd8ec75f 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts @@ -1,14 +1,14 @@ // #docplaster // #docregion -import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; +import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; import { HeroCacheService } from './hero-cache.service'; import { LoggerService } from './logger.service'; // #docregion component @Component({ - selector:'hero-contact', - template:` + selector: 'hero-contact', + template: `
Phone #: {{phoneNumber}} !!!
` }) diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts index decccdbf72..10cdbcaab1 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts @@ -4,10 +4,10 @@ import { Hero } from './hero'; export class HeroData { createDb() { let heroes = [ - new Hero(1,"Windstorm"), - new Hero(2,"Bombasto"), - new Hero(3,"Magneta"), - new Hero(4,"Tornado") + new Hero(1, 'Windstorm'), + new Hero(2, 'Bombasto'), + new Hero(3, 'Magneta'), + new Hero(4, 'Tornado') ]; return {heroes}; } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts index 0222f6cd32..9a7bdccd02 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts @@ -5,18 +5,18 @@ import { Hero } from './hero'; @Injectable() export class HeroService { - //TODO move to database - private heroes:Array = [ - new Hero(1, 'RubberMan','Hero of many talents', '123-456-7899'), - new Hero(2, 'Magma','Hero of all trades', '555-555-5555'), - new Hero(3, 'Mr. Nice','The name says it all','111-222-3333') + // TODO move to database + private heroes: Array = [ + new Hero(1, 'RubberMan', 'Hero of many talents', '123-456-7899'), + new Hero(2, 'Magma', 'Hero of all trades', '555-555-5555'), + new Hero(3, 'Mr. Nice', 'The name says it all', '111-222-3333') ]; - getHeroById(id:number):Hero{ + getHeroById(id: number): Hero { return this.heroes.filter(hero => hero.id === id)[0]; } - getAllHeroes():Array{ + getAllHeroes(): Array { return this.heroes; } } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts index 51ce8ebbff..c17069e727 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts @@ -1,9 +1,9 @@ // #docregion -export class Hero{ +export class Hero { constructor( public id: number, - public name:string, - public description?:string, - public phone?:string) { + public name: string, + public description?: string, + public phone?: string) { } -} \ No newline at end of file +} diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts index 045ce8c545..8d0d8cc466 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts @@ -23,7 +23,7 @@ const provideParent = // #enddocregion provide-parent, provide-the-parent // #docregion provide-parent (component: any, parentType?: any) => { - return { provide: parentType || Parent, useExisting: forwardRef(() => component) } + return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; }; // #enddocregion provide-parent @@ -31,7 +31,7 @@ const provideParent = const provideTheParent = // #docregion provide-the-parent (component: any) => { - return { provide: Parent, useExisting: forwardRef(() => component) } + return { provide: Parent, useExisting: forwardRef(() => component) }; }; // #enddocregion provide-the-parent diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts index 782e65043d..ed394fc734 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts @@ -9,19 +9,19 @@ import { UserService } from './user.service'; @Injectable() export class UserContextService { // #enddocregion injectables, injectable - name:string; - role:string; - loggedInSince:Date; + name: string; + role: string; + loggedInSince: Date; // #docregion ctor, injectables - constructor(private userService:UserService, private loggerService:LoggerService){ + constructor(private userService: UserService, private loggerService: LoggerService) { // #enddocregion ctor, injectables this.loggedInSince = new Date(); // #docregion ctor, injectables } // #enddocregion ctor, injectables - loadUser(userId:number){ + loadUser(userId: number) { let user = this.userService.getUserById(userId); this.name = user.name; this.role = user.role; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts index d4ca4fda2a..c48b025a08 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts @@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'; @Injectable() export class UserService { - getUserById(userId:number):any{ - return {name:'Bombasto',role:'Admin'}; + getUserById(userId: number): any { + return {name: 'Bombasto', role: 'Admin'}; } } diff --git a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts index d526626b24..3915d9cf90 100644 --- a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts +++ b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts @@ -15,7 +15,7 @@ describe('Dynamic Form', function () { emailElement.sendKeys(email); expect(emailElement.getAttribute('value')).toEqual(email); - element(by.css('select option[value="solid"]')).click() + element(by.css('select option[value="solid"]')).click(); let saveButton = element.all(by.css('button')).get(0); saveButton.click().then(function(){ diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts index 01a5401003..74a4909de3 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; import { DynamicForm } from './dynamic-form.component'; import { QuestionService } from './question.service'; @@ -16,7 +16,7 @@ import { QuestionService } from './question.service'; providers: [QuestionService] }) export class AppComponent { - questions:any[] + questions: any[]; constructor(service: QuestionService) { this.questions = service.getQuestions(); diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts index d039931f61..0593fd523e 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts @@ -5,11 +5,11 @@ import { ControlGroup } from '@angular/common'; import { QuestionBase } from './question-base'; @Component({ - selector:'df-question', - templateUrl:'app/dynamic-form-question.component.html' + selector: 'df-question', + templateUrl: 'app/dynamic-form-question.component.html' }) export class DynamicFormQuestionComponent { - @Input() question:QuestionBase; - @Input() form:ControlGroup; + @Input() question: QuestionBase; + @Input() form: ControlGroup; get isValid() { return this.form.controls[this.question.key].valid; } } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts index 68aafc839b..a6374871ab 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts @@ -7,8 +7,8 @@ import { QuestionControlService } from './question-control.service'; import { DynamicFormQuestionComponent } from './dynamic-form-question.component'; @Component({ - selector:'dynamic-form', - templateUrl:'app/dynamic-form.component.html', + selector: 'dynamic-form', + templateUrl: 'app/dynamic-form.component.html', directives: [DynamicFormQuestionComponent], providers: [QuestionControlService] }) @@ -20,7 +20,7 @@ export class DynamicForm { constructor(private qcs: QuestionControlService) { } - ngOnInit(){ + ngOnInit() { this.form = this.qcs.toControlGroup(this.questions); } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/main.ts b/public/docs/_examples/cb-dynamic-form/ts/app/main.ts index aca0a06056..5a8d9c5044 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/main.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/main.ts @@ -3,4 +3,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; bootstrap(AppComponent, []) - .catch((err:any) => console.error(err)); + .catch((err: any) => console.error(err)); diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts index c22de02989..2b32b00f2a 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts @@ -1,20 +1,20 @@ // #docregion export class QuestionBase{ - value:T; - key:string; - label:string; - required:boolean; - order:number; - controlType:string; + value: T; + key: string; + label: string; + required: boolean; + order: number; + controlType: string; - constructor(options:{ - value?:T, - key?:string, - label?:string, - required?:boolean, - order?:number, - controlType?:string - } = {}){ + constructor(options: { + value?: T, + key?: string, + label?: string, + required?: boolean, + order?: number, + controlType?: string + } = {}) { this.value = options.value; this.key = options.key || ''; this.label = options.label || ''; diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts index d4cf25951c..fb86366c51 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts @@ -5,9 +5,9 @@ import { QuestionBase } from './question-base'; @Injectable() export class QuestionControlService { - constructor(private fb:FormBuilder){ } + constructor(private fb: FormBuilder) { } - toControlGroup(questions:QuestionBase[] ) { + toControlGroup(questions: QuestionBase[] ) { let group = {}; questions.forEach(question => { diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts index 50b5d64a1d..35a9074c74 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts @@ -1,11 +1,11 @@ // #docregion import { QuestionBase } from './question-base'; -export class DropdownQuestion extends QuestionBase{ +export class DropdownQuestion extends QuestionBase { controlType = 'dropdown'; - options:{key:string, value:string}[] = []; + options: {key: string, value: string}[] = []; - constructor(options:{} = {}){ + constructor(options: {} = {}) { super(options); this.options = options['options'] || []; } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts index a1c9980de5..aaa7edf267 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts @@ -1,11 +1,11 @@ // #docregion import { QuestionBase } from './question-base'; -export class TextboxQuestion extends QuestionBase{ +export class TextboxQuestion extends QuestionBase { controlType = 'textbox'; - type:string; + type: string; - constructor(options:{} = {}){ + constructor(options: {} = {}) { super(options); this.type = options['type'] || ''; } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts index 52b4fc70ff..7ba417ee3c 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts @@ -13,36 +13,36 @@ export class QuestionService { // Todo: make asynchronous getQuestions() { - let questions:QuestionBase[] = [ + let questions: QuestionBase[] = [ new DropdownQuestion({ - key:'brave', + key: 'brave', label: 'Bravery Rating', options: [ - {key:'solid', value:'Solid'}, - {key:'great', value:'Great'}, - {key:'good', value:'Good'}, - {key:'unproven',value:'Unproven'} + {key: 'solid', value: 'Solid'}, + {key: 'great', value: 'Great'}, + {key: 'good', value: 'Good'}, + {key: 'unproven', value: 'Unproven'} ], order: 3 }), new TextboxQuestion({ - key:'firstName', - label:'First name', - value:'Bombasto', + key: 'firstName', + label: 'First name', + value: 'Bombasto', required: true, order: 1 }), new TextboxQuestion({ - key:'emailAddress', - label:'Email', + key: 'emailAddress', + label: 'Email', type: 'email', order: 2 }) ]; - return questions.sort((a,b) => a.order - b.order); + return questions.sort((a, b) => a.order - b.order); } } diff --git a/public/docs/_examples/cb-set-document-title/ts/app/main.ts b/public/docs/_examples/cb-set-document-title/ts/app/main.ts index c5134d3214..abee7afb87 100644 --- a/public/docs/_examples/cb-set-document-title/ts/app/main.ts +++ b/public/docs/_examples/cb-set-document-title/ts/app/main.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // #docregion import { bootstrap } from '@angular/platform-browser-dynamic'; diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts index 6ed0b9166d..da11e56b8a 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts @@ -21,11 +21,11 @@ export class TitleComponent { constructor( @Inject('titlePrefix') @Optional() - private titlePrefix:string, + private titlePrefix: string, @Attribute('title') - private title:string, + private title: string, @Query('okMsg') - private msg:QueryList) { + private msg: QueryList) { } ok() { diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts index 5d78a5cbbf..4865f9eb22 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts @@ -8,7 +8,7 @@ import { Component, Inject } from '@angular/core'; export class HeroComponent { constructor( @Inject('heroName') - private name:string) { + private name: string) { } } // #enddocregion diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts index e6b81b6af7..2f3fa267ba 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts @@ -8,8 +8,8 @@ import { DataService } from './data.service'; template: `

Hero: {{name}}

` }) export class HeroComponent { - name:string; - constructor(dataService:DataService) { + name: string; + constructor(dataService: DataService) { this.name = dataService.getHeroName(); } } diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts index 936bf2854e..a93b9ed08c 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts @@ -13,8 +13,8 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; ` }) export class ConfirmComponent { - @Input() okMsg:string; - @Input('cancelMsg') notOkMsg:string; + @Input() okMsg: string; + @Input('cancelMsg') notOkMsg: string; @Output() ok = new EventEmitter(); @Output('cancel') notOk = @@ -44,8 +44,8 @@ export class ConfirmComponent { directives: [ConfirmComponent] }) export class AppComponent { - okClicked:boolean; - cancelClicked:boolean; + okClicked: boolean; + cancelClicked: boolean; onOk() { this.okClicked = true; diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts index 94d79274fc..c883658135 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts @@ -11,7 +11,7 @@ import { Component, OnInit } // #docregion export class HeroComponent implements OnInit { - name:string; + name: string; ngOnInit() { this.name = 'Windstorm'; } diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts index 85d2772c63..a1628a1104 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts @@ -4,14 +4,14 @@ import { Component } from '@angular/core'; @Component({ selector: 'hero-view', - template: + template: '

Hero: {{getName()}}

' }) // #docregion appexport // #docregion class export class HeroComponent { title = 'Hero Detail'; - getName() {return 'Windstorm';} + getName() {return 'Windstorm'; } } // #enddocregion class // #enddocregion appexport diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts index 317d434b9d..71c75bb5c8 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts @@ -10,8 +10,8 @@ import { Component, HostBinding, HostListener } from '@angular/core'; export class HeroesComponent { @HostBinding() title = 'Tooltip content'; @HostBinding('class.heading') - hClass = true - active:boolean; + hClass = true; + active: boolean; constructor() {} @@ -21,7 +21,7 @@ export class HeroesComponent { } @HostListener('dblclick', ['$event']) - doubleClicked(evt:Event) { + doubleClicked(evt: Event) { this.active = true; } } diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts index 68ccb975e7..be8176e951 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts @@ -14,7 +14,7 @@ import { ` }) class ActiveLabelComponent { - active:boolean; + active: boolean; activate() { this.active = true; @@ -30,11 +30,11 @@ class ActiveLabelComponent { ` }) class HeroComponent { - @Input() hero:any; - active:boolean; + @Input() hero: any; + active: boolean; @ContentChild(ActiveLabelComponent) - label:ActiveLabelComponent + label: ActiveLabelComponent; activate() { this.active = true; @@ -68,7 +68,7 @@ export class HeroesQueriesComponent { ]; @ViewChildren(HeroComponent) - heroCmps:QueryList; + heroCmps: QueryList; activate() { this.heroCmps.forEach( diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts index ea8f8377e1..340b0b9a0d 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts @@ -1,8 +1,6 @@ // #docregion ng2import import { bootstrap } from '@angular/platform-browser-dynamic'; -import { -} from '@angular/router'; import { LocationStrategy, HashLocationStrategy diff --git a/public/docs/_examples/component-styles/ts/app/hero-app.component.ts b/public/docs/_examples/component-styles/ts/app/hero-app.component.ts index b196584abb..7386226e71 100644 --- a/public/docs/_examples/component-styles/ts/app/hero-app.component.ts +++ b/public/docs/_examples/component-styles/ts/app/hero-app.component.ts @@ -16,7 +16,7 @@ export class HeroAppComponent { hero = new Hero( 'Human Torch', ['Mister Fantastic', 'Invisible Woman', 'Thing'] - ) + ); @HostBinding('class') get themeClass() { return 'theme-light'; diff --git a/public/docs/_examples/component-styles/ts/app/hero.ts b/public/docs/_examples/component-styles/ts/app/hero.ts index 8b58c8a8f8..7f8969e682 100644 --- a/public/docs/_examples/component-styles/ts/app/hero.ts +++ b/public/docs/_examples/component-styles/ts/app/hero.ts @@ -1,7 +1,7 @@ export class Hero { - active:boolean; + active: boolean; - constructor(public name:string, - public team:string[]) { + constructor(public name: string, + public team: string[]) { } } diff --git a/public/docs/_examples/dependency-injection/e2e-spec.ts b/public/docs/_examples/dependency-injection/e2e-spec.ts index 1f7226867d..d4625478f3 100644 --- a/public/docs/_examples/dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/dependency-injection/e2e-spec.ts @@ -123,7 +123,7 @@ describe('Dependency Injection Tests', function () { it('P10 (optional dependency) displays as expected', function () { expectedMsg = 'Optional logger was not available'; expect(element(by.css('#p10')).getText()).toEqual(expectedMsg); - }) + }); }); describe('User/Heroes:', function() { @@ -163,8 +163,8 @@ describe('Dependency Injection Tests', function () { describe('after button click', function() { beforeAll(function (done) { - let buttonEle = element.all(by.cssContainingText('button','Next User')).get(0); - buttonEle.click().then(done,done); + let buttonEle = element.all(by.cssContainingText('button', 'Next User')).get(0); + buttonEle.click().then(done, done); }); it('User is Alice - authorized', function () { diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts index bec40f397d..a67946ac19 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts @@ -13,7 +13,7 @@ import { HeroesComponent } from './heroes/heroes.component.1'; `, - directives:[CarComponent, HeroesComponent] + directives: [CarComponent, HeroesComponent] }) export class AppComponent { diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts index 78e3f5483e..a6106cbc4b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts @@ -17,7 +17,7 @@ import { Logger } from './logger.service'; `, - directives:[CarComponent, HeroesComponent], + directives: [CarComponent, HeroesComponent], providers: [ Logger, // #docregion providers @@ -26,10 +26,10 @@ import { Logger } from './logger.service'; ] }) export class AppComponent { - title:string; + title: string; // #docregion ctor - constructor(@Inject(APP_CONFIG) config:AppConfig) { + constructor(@Inject(APP_CONFIG) config: AppConfig) { this.title = config.title; } // #enddocregion ctor diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.ts index 659d5c1faf..21e0d59448 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.ts @@ -31,7 +31,7 @@ import { ProvidersComponent } from './providers.component'; `, - directives:[CarComponent, HeroesComponent, + directives: [CarComponent, HeroesComponent, InjectorComponent, TestComponent, ProvidersComponent], // #docregion providers providers: [ @@ -42,22 +42,22 @@ import { ProvidersComponent } from './providers.component'; // #enddocregion providers }) export class AppComponent { - title:string; + title: string; // #docregion ctor constructor( - @Inject(APP_CONFIG) config:AppConfig, + @Inject(APP_CONFIG) config: AppConfig, private userService: UserService) { this.title = config.title; } // #enddocregion ctor - get isAuthorized() { return this.user.isAuthorized;} + get isAuthorized() { return this.user.isAuthorized; } nextUser() { this.userService.getNewUser(); } get user() { return this.userService.user; } get userInfo() { - return `Current user, ${this.user.name}, is `+ + return `Current user, ${this.user.name}, is ` + `${this.isAuthorized ? '' : 'not'} authorized. `; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/app.config.ts b/public/docs/_examples/dependency-injection/ts/app/app.config.ts index fcffa83628..7626c46e5b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.config.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.config.ts @@ -4,10 +4,10 @@ import { OpaqueToken } from '@angular/core'; export let APP_CONFIG = new OpaqueToken('app.config'); // #enddocregion token -//#docregion config +// #docregion config export interface AppConfig { - apiEndpoint: string, - title: string + apiEndpoint: string; + title: string; } export const HERO_DI_CONFIG: AppConfig = { diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts index 2693ba37ca..c758c72951 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts @@ -5,42 +5,42 @@ import { Car, Engine, Tires } from './car'; ///////// example 1 //////////// export function simpleCar() { - //#docregion car-ctor-instantiation + // #docregion car-ctor-instantiation // Simple car with 4 cylinders and Flintstone tires. - var car = new Car(new Engine(), new Tires()); - //#enddocregion car-ctor-instantiation + let car = new Car(new Engine(), new Tires()); + // #enddocregion car-ctor-instantiation car.description = 'Simple'; return car; } ///////// example 2 //////////// -//#docregion car-ctor-instantiation-with-param +// #docregion car-ctor-instantiation-with-param class Engine2 { constructor(public cylinders: number) { } } -//#enddocregion car-ctor-instantiation-with-param +// #enddocregion car-ctor-instantiation-with-param export function superCar() { -//#docregion car-ctor-instantiation-with-param +// #docregion car-ctor-instantiation-with-param // Super car with 12 cylinders and Flintstone tires. - var bigCylinders = 12; - var car = new Car(new Engine2(bigCylinders), new Tires()); -//#enddocregion car-ctor-instantiation-with-param + let bigCylinders = 12; + let car = new Car(new Engine2(bigCylinders), new Tires()); +// #enddocregion car-ctor-instantiation-with-param car.description = 'Super'; return car; } /////////// example 3 ////////// - //#docregion car-ctor-instantiation-with-mocks + // #docregion car-ctor-instantiation-with-mocks class MockEngine extends Engine { cylinders = 8; } - class MockTires extends Tires { make = "YokoGoodStone"; } + class MockTires extends Tires { make = 'YokoGoodStone'; } - //#enddocregion car-ctor-instantiation-with-mocks + // #enddocregion car-ctor-instantiation-with-mocks export function testCar() { - //#docregion car-ctor-instantiation-with-mocks + // #docregion car-ctor-instantiation-with-mocks // Test car with 8 cylinders and YokoGoodStone tires. - var car = new Car(new MockEngine(), new MockTires()); - //#enddocregion car-ctor-instantiation-with-mocks + let car = new Car(new MockEngine(), new MockTires()); + // #enddocregion car-ctor-instantiation-with-mocks car.description = 'Test'; return car; } diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts index 04d379785f..4f7498ee4e 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts @@ -5,23 +5,23 @@ import { Logger } from '../logger.service'; // #docregion injector export function useInjector() { - var injector: ReflectiveInjector; + let injector: ReflectiveInjector; // #enddocregion injector /* // #docregion injector-no-new // Cannot instantiate an ReflectiveInjector like this! - var injector = new ReflectiveInjector([Car, Engine, Tires]); + let injector = new ReflectiveInjector([Car, Engine, Tires]); // #enddocregion injector-no-new */ // #docregion injector, injector-create-and-call injector = ReflectiveInjector.resolveAndCreate([Car, Engine, Tires]); // #docregion injector-call - var car = injector.get(Car); + let car = injector.get(Car); // #enddocregion injector-call, injector-create-and-call car.description = 'Injector'; injector = ReflectiveInjector.resolveAndCreate([Logger]); - var logger = injector.get(Logger); - logger.log('Injector car.drive() said: '+car.drive()); + let logger = injector.get(Logger); + logger.log('Injector car.drive() said: ' + car.drive()); return car; } diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts index 059dccd4b7..9026edebc2 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts @@ -1,10 +1,10 @@ // Car without DI import { Engine, Tires } from './car'; -//#docregion car +// #docregion car export class Car { - //#docregion car-ctor + // #docregion car-ctor public engine: Engine; public tires: Tires; public description = 'No DI'; @@ -13,12 +13,12 @@ export class Car { this.engine = new Engine(); this.tires = new Tires(); } - //#enddocregion car-ctor + // #enddocregion car-ctor // Method using the engine and tires drive() { return `${this.description} car with ` + - `${this.engine.cylinders} cylinders and ${this.tires.make} tires.` + `${this.engine.cylinders} cylinders and ${this.tires.make} tires.`; } } -//#enddocregion car \ No newline at end of file +// #enddocregion car diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car.ts b/public/docs/_examples/dependency-injection/ts/app/car/car.ts index 0e4a4a1415..37162c570b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car.ts @@ -11,7 +11,7 @@ export class Tires { @Injectable() export class Car { - //#docregion car-ctor + // #docregion car-ctor public description = 'DI'; constructor(public engine: Engine, public tires: Tires) { } @@ -20,6 +20,6 @@ export class Car { // Method using the engine and tires drive() { return `${this.description} car with ` + - `${this.engine.cylinders} cylinders and ${this.tires.make} tires.` + `${this.engine.cylinders} cylinders and ${this.tires.make} tires.`; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts index e841669661..db3a325bdb 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable:one-line */ // #docregion import { Component } from '@angular/core'; diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts index 0947d60494..a9d5462818 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts @@ -8,12 +8,12 @@ import { Logger } from '../logger.service'; @Injectable() export class HeroService { - //#docregion ctor + // #docregion ctor constructor(private logger: Logger) { } - //#enddocregion ctor + // #enddocregion ctor getHeroes() { - this.logger.log('Getting heroes ...') + this.logger.log('Getting heroes ...'); return HEROES; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts index 557e9b9534..13008f0109 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts @@ -1,3 +1,4 @@ +/* tslint:disable:one-line */ // #docregion import { HeroService } from './hero.service'; import { Logger } from '../logger.service'; @@ -6,7 +7,7 @@ import { UserService } from '../user.service'; // #docregion factory let heroServiceFactory = (logger: Logger, userService: UserService) => { return new HeroService(logger, userService.user.isAuthorized); -} +}; // #enddocregion factory // #docregion provider diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts index 7e84ae5058..6d058f52d9 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts @@ -7,7 +7,7 @@ import { Logger } from '../logger.service'; @Injectable() export class HeroService { - private _user:string; + private _user: string; // #docregion internals constructor( @@ -15,7 +15,7 @@ export class HeroService { private isAuthorized: boolean) { } getHeroes() { - let auth = this.isAuthorized ? 'authorized ': 'unauthorized'; + let auth = this.isAuthorized ? 'authorized ' : 'unauthorized'; this.logger.log(`Getting heroes for ${auth} user.`); return HEROES.filter(hero => this.isAuthorized || !hero.isSecret); } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts index 247b8c7841..9d25972eb0 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts @@ -21,8 +21,8 @@ import { HeroService } from './hero.service'; `, // #enddocregion v1 - providers:[HeroService], + providers: [HeroService], // #docregion v1 - directives:[HeroListComponent] + directives: [HeroListComponent] }) export class HeroesComponent { } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts index de46be16c3..dd2346248c 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { HeroListComponent } from './hero-list.component'; -import { heroServiceProvider} from './hero.service.provider'; +import { heroServiceProvider } from './hero.service.provider'; @Component({ selector: 'my-heroes', @@ -10,7 +10,7 @@ import { heroServiceProvider} from './hero.service.provider';

Heroes

`, - providers:[heroServiceProvider], - directives:[HeroListComponent] + providers: [heroServiceProvider], + directives: [HeroListComponent] }) export class HeroesComponent { } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts index 98695e90ce..79a91dc03a 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts @@ -2,14 +2,14 @@ import { Hero } from './hero'; export var HEROES: Hero[] = [ - { id: 11, isSecret: false, name: "Mr. Nice" }, - { id: 12, isSecret: false, name: "Narco" }, - { id: 13, isSecret: false, name: "Bombasto" }, - { id: 14, isSecret: false, name: "Celeritas" }, - { id: 15, isSecret: false, name: "Magneta" }, - { id: 16, isSecret: false, name: "RubberMan" }, - { id: 17, isSecret: false, name: "Dynama" }, - { id: 18, isSecret: true, name: "Dr IQ" }, - { id: 19, isSecret: true, name: "Magma" }, - { id: 20, isSecret: true, name: "Tornado" } + { id: 11, isSecret: false, name: 'Mr. Nice' }, + { id: 12, isSecret: false, name: 'Narco' }, + { id: 13, isSecret: false, name: 'Bombasto' }, + { id: 14, isSecret: false, name: 'Celeritas' }, + { id: 15, isSecret: false, name: 'Magneta' }, + { id: 16, isSecret: false, name: 'RubberMan' }, + { id: 17, isSecret: false, name: 'Dynama' }, + { id: 18, isSecret: true, name: 'Dr IQ' }, + { id: 19, isSecret: true, name: 'Magma' }, + { id: 20, isSecret: true, name: 'Tornado' } ]; diff --git a/public/docs/_examples/dependency-injection/ts/app/injector.component.ts b/public/docs/_examples/dependency-injection/ts/app/injector.component.ts index 84c8de4a95..7c9e8a56e5 100644 --- a/public/docs/_examples/dependency-injection/ts/app/injector.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/injector.component.ts @@ -20,8 +20,6 @@ import { Logger } from './logger.service'; providers: [Car, Engine, Tires, heroServiceProvider, Logger] }) export class InjectorComponent { - constructor(private injector: Injector) { } - car: Car = this.injector.get(Car); // #docregion get-hero-service @@ -29,8 +27,10 @@ export class InjectorComponent { // #enddocregion get-hero-service hero: Hero = this.heroService.getHeroes()[0]; + constructor(private injector: Injector) { } + get rodent() { - let rousDontExist = "R.O.U.S.'s? I don't think they exist!"; + let rousDontExist = `R.O.U.S.'s? I don't think they exist!`; return this.injector.get(ROUS, rousDontExist); } } diff --git a/public/docs/_examples/dependency-injection/ts/app/logger.service.ts b/public/docs/_examples/dependency-injection/ts/app/logger.service.ts index 4812ccd3ac..e943523ad2 100644 --- a/public/docs/_examples/dependency-injection/ts/app/logger.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/logger.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; @Injectable() export class Logger { - logs:string[] = []; // capture logs for testing + logs: string[] = []; // capture logs for testing log(message: string) { this.logs.push(message); diff --git a/public/docs/_examples/dependency-injection/ts/app/main.1.ts b/public/docs/_examples/dependency-injection/ts/app/main.1.ts index 56169511d5..0d83503360 100644 --- a/public/docs/_examples/dependency-injection/ts/app/main.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/main.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component.1'; import { HeroService } from './heroes/hero.service.1'; @@ -5,8 +6,8 @@ import { HeroService } from './heroes/hero.service.1'; bootstrap(AppComponent); function discouraged() { - //#docregion bootstrap-discouraged + // #docregion bootstrap-discouraged bootstrap(AppComponent, [HeroService]); // DISCOURAGED (but works) - //#enddocregion bootstrap-discouraged + // #enddocregion bootstrap-discouraged } diff --git a/public/docs/_examples/dependency-injection/ts/app/main.ts b/public/docs/_examples/dependency-injection/ts/app/main.ts index 8e480e8d7f..2f002de7d9 100644 --- a/public/docs/_examples/dependency-injection/ts/app/main.ts +++ b/public/docs/_examples/dependency-injection/ts/app/main.ts @@ -2,7 +2,7 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; import { ProvidersComponent } from './providers.component'; -//#docregion bootstrap +// #docregion bootstrap bootstrap(AppComponent); -//#enddocregion bootstrap +// #enddocregion bootstrap bootstrap(ProvidersComponent); diff --git a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts index 640247d4b6..61c53bb862 100644 --- a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts @@ -235,8 +235,9 @@ export class ProviderComponent10 { log: string; // #docregion provider-10-ctor constructor(@Optional() private logger: Logger) { - if (this.logger) + if (this.logger) { this.logger.log(some_message); + } } // #enddocregion provider-10-ctor diff --git a/public/docs/_examples/dependency-injection/ts/app/test.component.ts b/public/docs/_examples/dependency-injection/ts/app/test.component.ts index 068cf65e7b..fc0fef75a8 100644 --- a/public/docs/_examples/dependency-injection/ts/app/test.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/test.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // Simulate a simple test // Reader should look to the testing chapter for the real thing @@ -20,15 +21,15 @@ export class TestComponent { ///////////////////////////////////// function runTests() { - //#docregion spec + // #docregion spec let expectedHeroes = [{name: 'A'}, {name: 'B'}] let mockService = {getHeroes: () => expectedHeroes } - it("should have heroes when HeroListComponent created", () => { + it('should have heroes when HeroListComponent created', () => { let hlc = new HeroListComponent(mockService); expect(hlc.heroes.length).toEqual(expectedHeroes.length); - }) - //#enddocregion spec + }); + // #enddocregion spec return testResults; } @@ -36,19 +37,19 @@ function runTests() { ////////////////////////////////// // Fake Jasmine infrastructure var testName: string; -var testResults: {pass:string; message:string}; +var testResults: {pass: string; message: string}; -function expect(actual:any) { +function expect(actual: any) { return { - toEqual: function(expected:any){ - testResults = actual === expected? - {pass:'passed', message: testName} : - {pass:'failed', message: `${testName}; expected ${actual} to equal ${expected}.`}; + toEqual: function(expected: any){ + testResults = actual === expected ? + {pass: 'passed', message: testName} : + {pass: 'failed', message: `${testName}; expected ${actual} to equal ${expected}.`}; } - } + }; } -function it(label:string, test: () => void) { +function it(label: string, test: () => void) { testName = label; test(); } diff --git a/public/docs/_examples/dependency-injection/ts/app/user.service.ts b/public/docs/_examples/dependency-injection/ts/app/user.service.ts index 25e09ecaf8..8fdda925db 100644 --- a/public/docs/_examples/dependency-injection/ts/app/user.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/user.service.ts @@ -1,10 +1,10 @@ // #docregion -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; export class User { constructor( - public name:string, - public isAuthorized:boolean = false) { } + public name: string, + public isAuthorized = false) { } } // Todo: get the user; don't 'new' it. diff --git a/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts b/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts index ed59b40b2c..d9b816e558 100644 --- a/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts +++ b/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts @@ -17,4 +17,4 @@ export class AppCtorComponent { this.myHero = 'Windstorm'; } } -// #enddocregion app-ctor \ No newline at end of file +// #enddocregion app-ctor diff --git a/public/docs/_examples/displaying-data/ts/app/app.component.3.ts b/public/docs/_examples/displaying-data/ts/app/app.component.3.ts index 301343f851..8ea79cce53 100644 --- a/public/docs/_examples/displaying-data/ts/app/app.component.3.ts +++ b/public/docs/_examples/displaying-data/ts/app/app.component.3.ts @@ -1,7 +1,7 @@ // #docregion -import { Component} from '@angular/core'; +import { Component } from '@angular/core'; // #docregion import-hero -import { Hero} from './hero'; +import { Hero } from './hero'; // #enddocregion import-hero @Component({ diff --git a/public/docs/_examples/displaying-data/ts/app/hero.ts b/public/docs/_examples/displaying-data/ts/app/hero.ts index 8b4f06b658..e6b3745186 100644 --- a/public/docs/_examples/displaying-data/ts/app/hero.ts +++ b/public/docs/_examples/displaying-data/ts/app/hero.ts @@ -2,8 +2,8 @@ export class Hero { constructor( // #docregion id-parameter - public id:number, + public id: number, // #enddocregion id-parameter - public name:string) { } + public name: string) { } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/displaying-data/ts/app/main.1.ts b/public/docs/_examples/displaying-data/ts/app/main.1.ts index 2e0a4bc6f4..b033da1575 100644 --- a/public/docs/_examples/displaying-data/ts/app/main.1.ts +++ b/public/docs/_examples/displaying-data/ts/app/main.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppCtorComponent } from './app-ctor.component'; @@ -8,9 +9,9 @@ import { AppComponent as v3 } from './app.component.3'; import { AppComponent as final } from './app.component'; // pick one -//bootstrap(v1); -//bootstrap(v2); -//bootstrap(v3); +// bootstrap(v1); +// bootstrap(v2); +// bootstrap(v3); bootstrap(final); // for doc testing diff --git a/public/docs/_examples/forms/ts/app/app.component.ts b/public/docs/_examples/forms/ts/app/app.component.ts index b8551a0520..2dcbc8037a 100644 --- a/public/docs/_examples/forms/ts/app/app.component.ts +++ b/public/docs/_examples/forms/ts/app/app.component.ts @@ -1,6 +1,6 @@ // #docregion import { Component } from '@angular/core'; -import { HeroFormComponent } from './hero-form.component' +import { HeroFormComponent } from './hero-form.component'; @Component({ selector: 'my-app', diff --git a/public/docs/_examples/forms/ts/app/hero-form.component.ts b/public/docs/_examples/forms/ts/app/hero-form.component.ts index c4876d8203..7ea7c44738 100644 --- a/public/docs/_examples/forms/ts/app/hero-form.component.ts +++ b/public/docs/_examples/forms/ts/app/hero-form.component.ts @@ -41,7 +41,7 @@ export class HeroFormComponent { this.model = new Hero(42, '', ''); // #enddocregion new-hero-v1 this.active = false; - setTimeout(()=> this.active=true, 0); + setTimeout(() => this.active = true, 0); // #docregion new-hero-v1 } // #enddocregion new-hero-v1 @@ -51,7 +51,7 @@ export class HeroFormComponent { // Reveal in html: // Name via form.controls = {{showFormControls(heroForm)}} - showFormControls(form:NgForm){ + showFormControls(form: NgForm) { return form && form.controls['name'] && // #docregion form-controls diff --git a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts index 1342869429..d3dbf6f392 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts @@ -6,8 +6,8 @@ describe('Hierarchical dependency injection', function () { }); it('should open with a card view', function () { - expect(element.all(by.cssContainingText('button','edit')).get(0).isDisplayed()).toBe(true, - "edit button should be displayed"); + expect(element.all(by.cssContainingText('button', 'edit')).get(0).isDisplayed()).toBe(true, + 'edit button should be displayed'); }); it('should have multiple heroes listed', function () { @@ -15,10 +15,10 @@ describe('Hierarchical dependency injection', function () { }); it('should change to editor view after selection', function () { - let editButtonEle = element.all(by.cssContainingText('button','edit')).get(0); + let editButtonEle = element.all(by.cssContainingText('button', 'edit')).get(0); editButtonEle.click().then(function() { - expect(editButtonEle.isDisplayed()).toBe(false, "edit button should be hidden after selection"); - }) + expect(editButtonEle.isDisplayed()).toBe(false, 'edit button should be hidden after selection'); + }); }); it('should be able to save editor change', function () { @@ -34,11 +34,11 @@ describe('Hierarchical dependency injection', function () { let heroEle = element.all(by.css('heroes-list li')).get(1); // get the 2nd span which is the name of the hero let heroNameEle = heroEle.all(by.css('hero-card span')).get(1); - let editButtonEle = heroEle.element(by.cssContainingText('button','edit')); + let editButtonEle = heroEle.element(by.cssContainingText('button', 'edit')); editButtonEle.click().then(function() { let inputEle = heroEle.element(by.css('hero-editor input')); // return inputEle.sendKeys("foo"); - return sendKeys(inputEle, "foo"); + return sendKeys(inputEle, 'foo'); }).then(function() { let buttonName = shouldSave ? 'save' : 'cancel'; let buttonEle = heroEle.element(by.cssContainingText('button', buttonName)); @@ -49,7 +49,7 @@ describe('Hierarchical dependency injection', function () { } else { expect(heroNameEle.getText()).not.toContain('foo'); } - }) + }); } diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts index abbeabf2b0..31602112f2 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts @@ -1,6 +1,6 @@ // #docregion export class EditItem { - editing: boolean + editing: boolean; constructor (public item: T) {} } // #docregion diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts index b863ee7af8..2f211e8799 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts @@ -2,8 +2,8 @@ import { Hero } from './hero'; export class HeroesService { heroes: Array = [ - { name: "RubberMan", power: 'flexibility'}, - { name: "Tornado", power: 'Weather changer'} + { name: 'RubberMan', power: 'flexibility'}, + { name: 'Tornado', power: 'Weather changer'} ]; getHeroes () { diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts index 5a96ae391b..d24e5a3274 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts @@ -4,7 +4,7 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { HeroesListComponent } from './heroes-list.component'; import { HeroesService } from './heroes.service'; -bootstrap(HeroesListComponent, [HeroesService]) +bootstrap(HeroesListComponent, [HeroesService]); /* Documentation artifact below // #docregion bad-alternative diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts index c81786b2a3..667b8a053d 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts @@ -8,16 +8,16 @@ export class RestoreService { this.currentItem = this.clone(item); } - getItem () :T { + getItem (): T { return this.currentItem; } - restoreItem () :T { + restoreItem (): T { this.currentItem = this.originalItem; return this.getItem(); } - clone (item: T) :T { + clone (item: T): T { // super poor clone implementation return JSON.parse(JSON.stringify(item)); } diff --git a/public/docs/_examples/homepage-hello-world/e2e-spec.ts b/public/docs/_examples/homepage-hello-world/e2e-spec.ts index 4200429a4f..260a111ec5 100644 --- a/public/docs/_examples/homepage-hello-world/e2e-spec.ts +++ b/public/docs/_examples/homepage-hello-world/e2e-spec.ts @@ -10,7 +10,7 @@ describe('Homepage Hello World', function () { it(`should display the label: ${expectedLabel}`, function () { expect(element(by.css('label')).getText()).toEqual(expectedLabel); }); - + it('should display entered name', function () { let testName = 'Bobby Joe'; let nameEle = element.all(by.css('input')).get(0); diff --git a/public/docs/_examples/homepage-todo/ts/app/todo.ts b/public/docs/_examples/homepage-todo/ts/app/todo.ts index 57070dc72c..35faec9705 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo.ts @@ -1,6 +1,6 @@ // #docregion // Declare an interaface for type safety export interface Todo { - text: string, - done: boolean + text: string; + done: boolean; } diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts index 96cb759eeb..aa85c13089 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts @@ -14,7 +14,7 @@ import { TodoForm } from './todo_form'; `, - styles:['a { cursor: pointer; cursor: hand; }'], + styles: ['a { cursor: pointer; cursor: hand; }'], directives: [TodoList, TodoForm] }) export class TodoApp { diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_form.ts b/public/docs/_examples/homepage-todo/ts/app/todo_form.ts index ecc8596772..98d32a6ef9 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_form.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_form.ts @@ -17,7 +17,7 @@ export class TodoForm { addTodo() { if (this.task) { - this.newTask.next({text:this.task, done:false}); + this.newTask.next({text: this.task, done: false}); } this.task = ''; } diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_list.ts b/public/docs/_examples/homepage-todo/ts/app/todo_list.ts index bdeff74a27..8738437429 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_list.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_list.ts @@ -1,5 +1,6 @@ // #docregion import { Component, Input } from '@angular/core'; + import { Todo } from './todo'; @Component({ diff --git a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts index 763fb3e5a0..ec6f5a5b4b 100644 --- a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts +++ b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts @@ -11,22 +11,22 @@ describe('Lifecycle hooks', function () { it('should support peek-a-boo', function () { let pabComp = element(by.css('peek-a-boo-parent peek-a-boo')); - expect(pabComp.isPresent()).toBe(false, "should not be able to find the 'peek-a-boo' component"); + expect(pabComp.isPresent()).toBe(false, 'should not be able to find the "peek-a-boo" component'); let pabButton = element.all(by.css('peek-a-boo-parent button')).get(0); let updateHeroButton = element.all(by.css('peek-a-boo-parent button')).get(1); expect(pabButton.getText()).toContain('Create Peek'); pabButton.click().then(function () { expect(pabButton.getText()).toContain('Destroy Peek'); - expect(pabComp.isDisplayed()).toBe(true, "should be able to see the 'peek-a-boo' component"); + expect(pabComp.isDisplayed()).toBe(true, 'should be able to see the "peek-a-boo" component'); expect(pabComp.getText()).toContain('Windstorm'); expect(pabComp.getText()).not.toContain('Windstorm!'); - expect(updateHeroButton.isPresent()).toBe(true, "should be able to see the update hero button"); + expect(updateHeroButton.isPresent()).toBe(true, 'should be able to see the update hero button'); return updateHeroButton.click(); }).then(function () { expect(pabComp.getText()).toContain('Windstorm!'); return pabButton.click(); }).then(function () { - expect(pabComp.isPresent()).toBe(false, "should no longer be able to find the 'peek-a-boo' component"); + expect(pabComp.isPresent()).toBe(false, 'should no longer be able to find the "peek-a-boo" component'); }); }); @@ -39,18 +39,18 @@ describe('Lifecycle hooks', function () { let changeLogEles = onChangesViewEle.all(by.css('div')); expect(titleEle.getText()).toContain('Windstorm can sing'); - expect(changeLogEles.count()).toEqual(2, "should start with 2 messages"); + expect(changeLogEles.count()).toEqual(2, 'should start with 2 messages'); // heroNameInputEle.sendKeys('-foo-').then(function () { sendKeys(heroNameInputEle, '-foo-').then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing'); - expect(changeLogEles.count()).toEqual(2, "should still have 2 messages"); + expect(changeLogEles.count()).toEqual(2, 'should still have 2 messages'); // protractor bug with sendKeys means that line below does not work. // return powerInputEle.sendKeys('-bar-'); return sendKeys(powerInputEle, '-bar-'); }).then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing-bar-'); // 7 == 2 previously + length of '-bar-' - expect(changeLogEles.count()).toEqual(7, "should have 7 messages now"); + expect(changeLogEles.count()).toEqual(7, 'should have 7 messages now'); }); }); @@ -66,16 +66,16 @@ describe('Lifecycle hooks', function () { expect(titleEle.getText()).toContain('Windstorm can sing'); changeLogEles.count().then(function(count) { // Empirically 5 messages to start - expect(count).toBeGreaterThan(4, "should start with some messages"); + expect(count).toBeGreaterThan(4, 'should start with some messages'); logCount = count; // heroNameInputEle.sendKeys('-foo-').then(function () { - return sendKeys(heroNameInputEle, '-foo-') + return sendKeys(heroNameInputEle, '-foo-'); }).then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing'); - return changeLogEles.count() + return changeLogEles.count(); }).then(function (count) { // two more for each keystroke except the 1st - expect(count).toEqual(logCount + 9, 'should add 9 more messages') + expect(count).toEqual(logCount + 9, 'should add 9 more messages'); logCount = count; // return powerInputEle.sendKeys('-bar-'); return sendKeys(powerInputEle, '-bar-'); @@ -99,18 +99,18 @@ describe('Lifecycle hooks', function () { logEles.count().then(function(count) { logCount = count; - return sendKeys(childViewInputEle, "-test-"); + return sendKeys(childViewInputEle, '-test-'); }).then(function() { expect(childViewInputEle.getAttribute('value')).toContain('-test-'); - expect(commentEle.isPresent()).toBe(true,'should have comment because >10 chars'); + expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars'); expect(commentEle.getText()).toContain('long name'); return logEles.count(); }).then(function(count) { - expect(logCount + 10).toEqual(count, "10 additional log messages should have been added"); + expect(logCount + 10).toEqual(count, '10 additional log messages should have been added'); logCount = count; return buttonEle.click(); }).then(function() { - expect(logEles.count()).toBeLessThan(logCount, "log should shrink after reset"); + expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset'); }); }); @@ -128,30 +128,30 @@ describe('Lifecycle hooks', function () { logEles.count().then(function(count) { logCount = count; - return sendKeys(childViewInputEle, "-test-"); + return sendKeys(childViewInputEle, '-test-'); }).then(function() { expect(childViewInputEle.getAttribute('value')).toContain('-test-'); - expect(commentEle.isPresent()).toBe(true,'should have comment because >10 chars'); + expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars'); expect(commentEle.getText()).toContain('long name'); return logEles.count(); }).then(function(count) { - expect(logCount + 10).toEqual(count, "10 additional log messages should have been added"); + expect(logCount + 10).toEqual(count, '10 additional log messages should have been added'); logCount = count; return buttonEle.click(); }).then(function() { - expect(logEles.count()).toBeLessThan(logCount, "log should shrink after reset"); + expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset'); }); }); it('should support spy\'s OnInit & OnDestroy hooks', function () { let inputEle = element(by.css('spy-parent input')); - let addHeroButtonEle = element(by.cssContainingText('spy-parent button','Add Hero')); - let resetHeroesButtonEle = element(by.cssContainingText('spy-parent button','Reset Heroes')); + let addHeroButtonEle = element(by.cssContainingText('spy-parent button', 'Add Hero')); + let resetHeroesButtonEle = element(by.cssContainingText('spy-parent button', 'Reset Heroes')); let heroEles = element.all(by.css('spy-parent div[mySpy')); let logEles = element.all(by.css('spy-parent h4 ~ div')); expect(heroEles.count()).toBe(2, 'should have two heroes displayed'); expect(logEles.count()).toBe(2, 'should have two log entries'); - sendKeys(inputEle, "-test-").then(function() { + sendKeys(inputEle, '-test-').then(function() { return addHeroButtonEle.click(); }).then(function() { expect(heroEles.count()).toBe(3, 'should have added one hero'); @@ -161,12 +161,12 @@ describe('Lifecycle hooks', function () { }).then(function() { expect(heroEles.count()).toBe(0, 'should no longer have any heroes'); expect(logEles.count()).toBe(7, 'should now have 7 log entries - 3 orig + 1 reset + 3 removeall'); - }) + }); }); it('should support "spy counter"', function () { - let updateCounterButtonEle = element(by.cssContainingText('counter-parent button','Update')); - let resetCounterButtonEle = element(by.cssContainingText('counter-parent button','Reset')); + let updateCounterButtonEle = element(by.cssContainingText('counter-parent button', 'Update')); + let resetCounterButtonEle = element(by.cssContainingText('counter-parent button', 'Reset')); let textEle = element(by.css('counter-parent my-counter > div')); let logEles = element.all(by.css('counter-parent h4 ~ div')); expect(textEle.getText()).toContain('Counter = 0'); @@ -178,8 +178,6 @@ describe('Lifecycle hooks', function () { }).then(function() { expect(textEle.getText()).toContain('Counter = 0'); expect(logEles.count()).toBe(7, 'should now have 7 log entries - 3 prev + 1 reset + 2 destroy + 1 init'); - }) + }); }); - - }); diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts index 6d970f8aa0..279a609ed3 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts @@ -2,7 +2,7 @@ // #docregion import { AfterContentChecked, AfterContentInit, Component, ContentChild } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; ////////////////// @Component({ @@ -63,7 +63,7 @@ export class AfterContentComponent implements AfterContentChecked, AfterContentI // This surrogate for real business logic sets the `comment` private doSomething() { - this.comment = this.contentChild.hero.length > 10 ? 'That\'s a long name' : ''; + this.comment = this.contentChild.hero.length > 10 ? `That's a long name` : ''; } private logIt(method: string) { diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts index 800a43fcc3..000cf348eb 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts @@ -2,7 +2,7 @@ // #docregion import { AfterViewChecked, AfterViewInit, Component, ViewChild } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; ////////////////// // #docregion child-view @@ -39,7 +39,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { @ViewChild(ChildViewComponent) viewChild: ChildViewComponent; // #enddocregion hooks - constructor(private logger:LoggerService){ + constructor(private logger: LoggerService) { this.logIt('AfterView constructor'); } @@ -67,7 +67,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { // #docregion do-something // This surrogate for real business logic sets the `comment` private doSomething() { - let c = this.viewChild.hero.length > 10 ? "That's a long name" : ''; + let c = this.viewChild.hero.length > 10 ? `That's a long name` : ''; if (c !== this.comment) { // Wait a tick because the component's view has already been checked this.logger.tick_then(() => this.comment = c); @@ -75,9 +75,9 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { } // #enddocregion do-something - private logIt(method:string){ + private logIt(method: string) { let child = this.viewChild; - let message = `${method}: ${child ? child.hero:'no'} child view` + let message = `${method}: ${child ? child.hero : 'no'} child view`; this.logger.log(message); } // #docregion hooks @@ -100,11 +100,11 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { `, styles: ['.parent {background: burlywood}'], - providers:[LoggerService], + providers: [LoggerService], directives: [AfterViewComponent] }) export class AfterViewParentComponent { - logs:string[]; + logs: string[]; show = true; constructor(private logger: LoggerService) { @@ -112,7 +112,7 @@ export class AfterViewParentComponent { } reset() { - this.logs.length=0; + this.logs.length = 0; // quickly remove and reload AfterViewComponent which recreates it this.show = false; this.logger.tick_then(() => this.show = true); diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts index 1485f2992a..c17bf24082 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts @@ -9,8 +9,8 @@ import { OnInit, SimpleChange } from '@angular/core'; -import {Component, Input} from '@angular/core'; -import {LoggerService} from './logger.service'; +import { Component, Input } from '@angular/core'; +import { LoggerService } from './logger.service'; let nextId = 1; diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts b/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts index ba7582ea50..6119771c60 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts @@ -1,7 +1,7 @@ // #docregion -import {Directive, OnInit, OnDestroy} from '@angular/core'; +import { Directive, OnInit, OnDestroy } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; let nextId = 1; diff --git a/public/docs/_examples/pipes/e2e-spec.ts b/public/docs/_examples/pipes/e2e-spec.ts index 9b626d48bb..2e2d3448af 100644 --- a/public/docs/_examples/pipes/e2e-spec.ts +++ b/public/docs/_examples/pipes/e2e-spec.ts @@ -7,7 +7,7 @@ describe('Pipes', function () { it('should open correctly', function () { expect(element.all(by.tagName('h1')).get(0).getText()).toEqual('Pipes'); - expect(element(by.css('hero-birthday p')).getText()).toEqual("The hero's birthday is Apr 15, 1988"); + expect(element(by.css('hero-birthday p')).getText()).toEqual(`The hero's birthday is Apr 15, 1988`); }); it('should show 4 heroes', function () { @@ -19,23 +19,23 @@ describe('Pipes', function () { }); it('should show alternate birthday formats', function () { - expect(element(by.cssContainingText('my-app > p', "The hero's birthday is Apr 15, 1988")).isDisplayed()).toBe(true); - expect(element(by.cssContainingText('my-app > p', "The hero's birthday is 04/15/88")).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('my-app > p', `The hero's birthday is Apr 15, 1988`)).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('my-app > p', `The hero's birthday is 04/15/88`)).isDisplayed()).toBe(true); }); it('should be able to toggle birthday formats', function () { let birthDayEle = element(by.css('hero-birthday2 > p')); - expect(birthDayEle.getText()).toEqual("The hero's birthday is 4/15/1988"); - let buttonEle = element(by.cssContainingText('hero-birthday2 > button', "Toggle Format")); + expect(birthDayEle.getText()).toEqual(`The hero's birthday is 4/15/1988`); + let buttonEle = element(by.cssContainingText('hero-birthday2 > button', 'Toggle Format')); expect(buttonEle.isDisplayed()).toBe(true); buttonEle.click().then(function() { - expect(birthDayEle.getText()).toEqual("The hero's birthday is Friday, April 15, 1988"); + expect(birthDayEle.getText()).toEqual(`The hero's birthday is Friday, April 15, 1988`); }); }); it('should be able to chain and compose pipes', function () { - let chainedPipeEles = element.all(by.cssContainingText('my-app p', "The chained hero's")); - expect(chainedPipeEles.count()).toBe(3, "should have 3 chained pipe examples"); + let chainedPipeEles = element.all(by.cssContainingText('my-app p', `The chained hero's`)); + expect(chainedPipeEles.count()).toBe(3, 'should have 3 chained pipe examples'); expect(chainedPipeEles.get(0).getText()).toContain('APR 15, 1988'); expect(chainedPipeEles.get(1).getText()).toContain('FRIDAY, APRIL 15, 1988'); expect(chainedPipeEles.get(2).getText()).toContain('FRIDAY, APRIL 15, 1988'); @@ -52,13 +52,13 @@ describe('Pipes', function () { let factorInputEle = eles.get(1); let outputEle = element(by.css('power-boost-calculator p')); baseInputEle.clear().then(function() { - return sendKeys(baseInputEle, "7"); + return sendKeys(baseInputEle, '7'); }).then(function() { return factorInputEle.clear(); }).then(function() { - return sendKeys(factorInputEle, "3"); + return sendKeys(factorInputEle, '3'); }).then(function() { - expect(outputEle.getText()).toContain("343"); + expect(outputEle.getText()).toContain('343'); }); }); @@ -73,14 +73,14 @@ describe('Pipes', function () { expect(canFlyCheckEle.getAttribute('checked')).toEqual('true', 'should default to "can fly"'); expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array'); expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly'); - - return sendKeys(nameEle, "test1\n") + + return sendKeys(nameEle, 'test1\n') .then(function(){ expect(flyingHeroesEle.count()).toEqual(2, 'no change while mutating array'); return mutateCheckEle.click(); }) .then(function() { - return sendKeys(nameEle, "test2\n"); + return sendKeys(nameEle, 'test2\n'); }) .then(function() { expect(flyingHeroesEle.count()).toEqual(4, 'not mutating; should see both adds'); @@ -90,25 +90,24 @@ describe('Pipes', function () { }) .then(function() { expect(flyingHeroesEle.count()).toEqual(2, 'reset should restore orginal flying heroes'); - }) + }); }); - - + + it('should support flying heroes (impure) ', function () { let nameEle = element(by.css('flying-heroes-impure input[type="text"]')); - let canFlyCheckEle = element(by.css('flying-heroes-impure #can-fly')); + let canFlyCheckEle = element(by.css('flying-heroes-impure #can-fly')); let mutateCheckEle = element(by.css('flying-heroes-impure #mutate')); - let resetEle = element(by.css('flying-heroes-impure button')); let flyingHeroesEle = element.all(by.css('flying-heroes-impure #flyers div')); expect(canFlyCheckEle.getAttribute('checked')).toEqual('true', 'should default to "can fly"'); expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array'); expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly'); - - return sendKeys(nameEle, "test1\n") + + return sendKeys(nameEle, 'test1\n') .then(function(){ expect(flyingHeroesEle.count()).toEqual(3, 'new flying hero should show in mutating array'); - }) + }); }); it('should show an async hero message', function () { diff --git a/public/docs/_examples/pipes/ts/app/app.component.ts b/public/docs/_examples/pipes/ts/app/app.component.ts index c79c1305df..c00656f4ea 100644 --- a/public/docs/_examples/pipes/ts/app/app.component.ts +++ b/public/docs/_examples/pipes/ts/app/app.component.ts @@ -14,7 +14,7 @@ import { PowerBoostCalculator } from './power-boost-calculator.component'; @Component({ selector: 'my-app', templateUrl: 'app/app.component.html', - directives:[ + directives: [ FlyingHeroesComponent, FlyingHeroesImpureComponent, HeroAsyncMessageComponent, HeroBirthday, @@ -22,8 +22,8 @@ import { PowerBoostCalculator } from './power-boost-calculator.component'; HeroListComponent, PowerBooster, PowerBoostCalculator ], - providers:[HTTP_PROVIDERS] + providers: [HTTP_PROVIDERS] }) export class AppComponent { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 } diff --git a/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts b/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts index 72fd58e178..003858c0b6 100644 --- a/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts +++ b/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts @@ -8,7 +8,7 @@ import { Http } from '@angular/http'; pure: false }) // #enddocregion pipe-metadata -export class FetchJsonPipe implements PipeTransform{ +export class FetchJsonPipe implements PipeTransform { private fetchedJson: any = null; private prevUrl = ''; diff --git a/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts b/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts index 94323297ba..d7bc01f94f 100644 --- a/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts +++ b/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts @@ -14,7 +14,7 @@ import { HEROES } from './heroes'; }) // #docregion v1 export class FlyingHeroesComponent { - heroes:any[] = []; + heroes: any[] = []; canFly = true; // #enddocregion v1 mutate = true; @@ -23,7 +23,7 @@ export class FlyingHeroesComponent { // #docregion v1 constructor() { this.reset(); } - addHero(name:string) { + addHero(name: string) { name = name.trim(); if (!name) { return; } let hero = {name, canFly: this.canFly}; @@ -33,7 +33,7 @@ export class FlyingHeroesComponent { // Impure pipe will display // #docregion v1 // #docregion push - this.heroes.push(hero) + this.heroes.push(hero); // #enddocregion push // #enddocregion v1 } else { diff --git a/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts b/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts index 3dee7d6757..eb9b0f172a 100644 --- a/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts +++ b/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts @@ -6,7 +6,7 @@ import { Flyer } from './heroes'; @Pipe({ name: 'flyingHeroes' }) export class FlyingHeroesPipe implements PipeTransform { - transform(allHeroes:Flyer[]) { + transform(allHeroes: Flyer[]) { // #docregion filter return allHeroes.filter(hero => hero.canFly); // #enddocregion filter diff --git a/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts b/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts index cced9f3e57..4e36ddd0cb 100644 --- a/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts @@ -10,7 +10,13 @@ import { Observable } from 'rxjs/Rx'; `, }) export class HeroAsyncMessageComponent { - message$:Observable; + message$: Observable; + + private messages = [ + 'You are my hero!', + 'You are the best hero!', + 'Will you be my hero?' + ]; constructor() { this.resend(); } @@ -19,12 +25,6 @@ export class HeroAsyncMessageComponent { .map(i => this.messages[i]) .take(this.messages.length); } - - private messages = [ - 'You are my hero!', - 'You are the best hero!', - 'Will you be my hero?' - ]; } // #enddocregion diff --git a/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts b/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts index 52a462757b..1759ccd43e 100644 --- a/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; @Component({ selector: 'hero-birthday', @@ -8,5 +8,5 @@ import { Component } from '@angular/core' // #enddocregion hero-birthday-template }) export class HeroBirthday { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 } diff --git a/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts b/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts index 683f082e27..7a0d016fe7 100644 --- a/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; @Component({ selector: 'hero-birthday2', @@ -12,9 +12,9 @@ import { Component } from '@angular/core' }) // #docregion class export class HeroBirthday2 { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 toggle = true; // start with true == shortDate - get format() { return this.toggle ? 'shortDate' : 'fullDate'} + get format() { return this.toggle ? 'shortDate' : 'fullDate'; } toggleFormat() { this.toggle = !this.toggle; } } diff --git a/public/docs/_examples/pipes/ts/app/heroes.ts b/public/docs/_examples/pipes/ts/app/heroes.ts index fe30ad84f4..b2edabe0da 100644 --- a/public/docs/_examples/pipes/ts/app/heroes.ts +++ b/public/docs/_examples/pipes/ts/app/heroes.ts @@ -1,7 +1,7 @@ -export interface Flyer { canFly: boolean } +export interface Flyer { canFly: boolean; } export const HEROES = [ - {"name": "Windstorm", "canFly": true}, - {"name": "Bombasto", "canFly": false}, - {"name": "Magneto", "canFly": false}, - {"name": "Tornado", "canFly": true} -]; \ No newline at end of file + {name: 'Windstorm', canFly: true}, + {name: 'Bombasto', canFly: false}, + {name: 'Magneto', canFly: false}, + {name: 'Tornado', canFly: true} +]; diff --git a/public/docs/_examples/router-deprecated/e2e-spec.ts b/public/docs/_examples/router-deprecated/e2e-spec.ts index 85b0598df5..961f5f7f50 100644 --- a/public/docs/_examples/router-deprecated/e2e-spec.ts +++ b/public/docs/_examples/router-deprecated/e2e-spec.ts @@ -23,36 +23,36 @@ describe('Router', function () { heroDetail: element(by.css('my-app > undefined > div')), heroDetailTitle: element(by.css('my-app > undefined > div > h3')), - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.crisisHref.getText()).toEqual("Crisis Center"); - expect(page.heroesHref.getText()).toEqual("Heroes"); + expect(page.crisisHref.getText()).toEqual('Crisis Center'); + expect(page.heroesHref.getText()).toEqual('Heroes'); }); it('should be able to see crises center items', function () { let page = getPageStruct(); - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries at start"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries at start'); }); it('should be able to see hero items', function () { let page = getPageStruct(); page.heroesHref.click().then(function() { expect(page.routerTitle.getText()).toContain('HEROES'); - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); it('should be able to toggle the views', function () { let page = getPageStruct(); page.crisisHref.click().then(function() { - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries'); return page.heroesHref.click(); }).then(function() { - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); @@ -77,7 +77,7 @@ describe('Router', function () { heroText = text.substr(text.indexOf(' ')).trim(); return heroEle.click(); }).then(function() { - expect(page.heroesList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.heroesList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.heroDetailTitle.getText()).toContain(heroText); let inputEle = page.heroDetail.element(by.css('input')); @@ -88,7 +88,7 @@ describe('Router', function () { return buttonEle.click(); }).then(function() { expect(heroEle.getText()).toContain(heroText + '-foo'); - }) + }); }); function crisisCenterEdit(index: number, shouldSave: boolean) { @@ -105,7 +105,7 @@ describe('Router', function () { crisisText = text.substr(text.indexOf(' ')).trim(); return crisisEle.click(); }).then(function () { - expect(page.crisisList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.crisisList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.crisisDetailTitle.getText()).toContain(crisisText); let inputEle = page.crisisDetail.element(by.css('input')); diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts index 5067e8aa3f..f5e820ca6f 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts @@ -39,4 +39,4 @@ export class AddCrisisComponent implements CanDeactivate { gotoCrises() { this.router.navigate(['CrisisCenter']); } -} \ No newline at end of file +} diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts index 496b8ba11e..6925fb8008 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts @@ -19,9 +19,9 @@ import { CrisisService } from './crisis.service'; // #docregion route-config @RouteConfig([ // #docregion default-route - {path:'/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, + {path: '/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, // #enddocregion default-route - {path:'/:id', name: 'CrisisDetail', component: CrisisDetailComponent} + {path: '/:id', name: 'CrisisDetail', component: CrisisDetailComponent} ]) // #enddocregion route-config export class CrisisCenterComponent { } diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts index 27f9ff09ac..3c735ae6ae 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts @@ -15,8 +15,8 @@ import { CrisisService } from './crisis.service'; providers: [CrisisService] }) @RouteConfig([ - {path:'/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, - {path:'/:id', name: 'CrisisDetail', component: CrisisDetailComponent} + {path: '/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, + {path: '/:id', name: 'CrisisDetail', component: CrisisDetailComponent} ]) export class CrisisCenterComponent { } // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts index 8fb93b371a..0c683853c9 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts @@ -60,7 +60,7 @@ export class CrisisDetailComponent implements OnInit, CanDeactivate { // #enddocregion ngOnInit // #docregion routerCanDeactivate - routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any { + routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction): any { // Allow synchronous navigation (`true`) if no crisis or the crisis is unchanged. if (!this.crisis || this.crisis.name === this.editName) { return true; diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts index aa90528a8a..143f0f061a 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts @@ -51,7 +51,7 @@ export class CrisisDetailComponent implements OnInit, CanDeactivate { }); } - routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any { + routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction): any { // Allow synchronous navigation (`true`) if no crisis or the crisis is unchanged. if (!this.crisis || this.crisis.name === this.editName) { return true; diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts index 949ccd4e00..da67b9e3f4 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts @@ -1,5 +1,4 @@ // #docplaster - // #docregion import { Injectable } from '@angular/core'; @@ -20,9 +19,9 @@ export class CrisisService { static nextCrisisId = 100; - addCrisis(name:string) { + addCrisis(name: string) { name = name.trim(); - if (name){ + if (name) { let crisis = new Crisis(CrisisService.nextCrisisId++, name); crisesPromise.then(crises => crises.push(crisis)); } @@ -30,12 +29,12 @@ export class CrisisService { // #docregion } -var crises = [ +let crises = [ new Crisis(1, 'Dragon Burning Cities'), new Crisis(2, 'Sky Rains Great White Sharks'), new Crisis(3, 'Giant Asteroid Heading For Earth'), new Crisis(4, 'Procrastinators Meeting Delayed Again'), ]; -var crisesPromise = Promise.resolve(crises); +let crisesPromise = Promise.resolve(crises); // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts b/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts index 3f5ceba475..71a342cbe8 100644 --- a/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts @@ -11,7 +11,7 @@ export class DialogService { * Ask user to confirm an action. `message` explains the action and choices. * Returns promise resolving to `true`=confirm or `false`=cancel */ - confirm(message?:string) { + confirm(message?: string) { return new Promise((resolve, reject) => resolve(window.confirm(message || 'Is it OK?'))); }; diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts index bb8509af21..ebfa0bf21d 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts @@ -26,9 +26,9 @@ export class HeroDetailComponent implements OnInit { // #docregion ctor constructor( - private router:Router, - private routeParams:RouteParams, - private service:HeroService){} + private router: Router, + private routeParams: RouteParams, + private service: HeroService) {} // #enddocregion ctor // #docregion ngOnInit diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts index abf4d4dd3b..10e73fd27b 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts @@ -26,9 +26,9 @@ export class HeroDetailComponent implements OnInit { // #docregion ctor constructor( - private router:Router, - private routeParams:RouteParams, - private service:HeroService){} + private router: Router, + private routeParams: RouteParams, + private service: HeroService) {} // #enddocregion ctor // #docregion ngOnInit diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts index cd11dc8e1a..cb1d20327c 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts @@ -30,7 +30,7 @@ export class HeroListComponent implements OnInit { // #enddocregion ctor ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } // #docregion select @@ -47,4 +47,4 @@ export class HeroListComponent implements OnInit { // #docregion link-parameters-array ['HeroDetail', { id: hero.id }] // {id: 15} // #enddocregion link-parameters-array -*/ \ No newline at end of file +*/ diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts index 0f27e98cd6..1ca787592f 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts @@ -50,7 +50,7 @@ export class HeroListComponent implements OnInit { ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } } // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts index a2c4495cb6..7e5cb468b9 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts @@ -15,13 +15,13 @@ export class HeroService { } } -var HEROES = [ - new Hero(11, 'Mr. Nice'), - new Hero(12, 'Narco'), - new Hero(13, 'Bombasto'), - new Hero(14, 'Celeritas'), - new Hero(15, 'Magneta'), - new Hero(16, 'RubberMan') +let HEROES = [ + new Hero(11, 'Mr. Nice'), + new Hero(12, 'Narco'), + new Hero(13, 'Bombasto'), + new Hero(14, 'Celeritas'), + new Hero(15, 'Magneta'), + new Hero(16, 'RubberMan') ]; -var heroesPromise = Promise.resolve(HEROES); +let heroesPromise = Promise.resolve(HEROES); diff --git a/public/docs/_examples/router-deprecated/ts/app/main.1.ts b/public/docs/_examples/router-deprecated/ts/app/main.1.ts index 8ff3ff84fb..ce110455d4 100644 --- a/public/docs/_examples/router-deprecated/ts/app/main.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/main.1.ts @@ -16,7 +16,7 @@ bootstrap(AppComponent, [ */ // Actually use the v.1 component -import { AppComponent as ac} from './app.component.1'; +import { AppComponent as ac } from './app.component.1'; bootstrap(ac, [ // #docregion all ROUTER_PROVIDERS diff --git a/public/docs/_examples/router/e2e-spec.ts b/public/docs/_examples/router/e2e-spec.ts index 780b5e229a..d674f7593c 100644 --- a/public/docs/_examples/router/e2e-spec.ts +++ b/public/docs/_examples/router/e2e-spec.ts @@ -23,36 +23,36 @@ describe('Router', function () { heroDetail: element(by.css('my-app > undefined > div')), heroDetailTitle: element(by.css('my-app > undefined > div > h3')), - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.crisisHref.getText()).toEqual("Crisis Center"); - expect(page.heroesHref.getText()).toEqual("Heroes"); + expect(page.crisisHref.getText()).toEqual('Crisis Center'); + expect(page.heroesHref.getText()).toEqual('Heroes'); }); it('should be able to see crises center items', function () { let page = getPageStruct(); - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries at start"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries at start'); }); it('should be able to see hero items', function () { let page = getPageStruct(); page.heroesHref.click().then(function() { expect(page.routerTitle.getText()).toContain('HEROES'); - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); it('should be able to toggle the views', function () { let page = getPageStruct(); page.crisisHref.click().then(function() { - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries'); return page.heroesHref.click(); }).then(function() { - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); @@ -77,7 +77,7 @@ describe('Router', function () { heroText = text.substr(text.indexOf(' ')).trim(); return heroEle.click(); }).then(function() { - expect(page.heroesList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.heroesList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.heroDetailTitle.getText()).toContain(heroText); let inputEle = page.heroDetail.element(by.css('input')); @@ -88,7 +88,7 @@ describe('Router', function () { return buttonEle.click(); }).then(function() { expect(heroEle.getText()).toContain(heroText + '-foo'); - }) + }); }); function crisisCenterEdit(index: number, shouldSave: boolean) { @@ -105,7 +105,7 @@ describe('Router', function () { crisisText = text.substr(text.indexOf(' ')).trim(); return crisisEle.click(); }).then(function () { - expect(page.crisisList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.crisisList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.crisisDetailTitle.getText()).toContain(crisisText); let inputEle = page.crisisDetail.element(by.css('input')); diff --git a/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts b/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts index 21ab9fba8c..7255cfb799 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts @@ -21,7 +21,7 @@ import { Hero, HeroService } from './hero.service'; `, }) -export class HeroDetailComponent implements OnActivate { +export class HeroDetailComponent implements OnActivate { hero: Hero; // #docregion ctor diff --git a/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts b/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts index 967ca97ccb..1b0bcf79dd 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts @@ -1,10 +1,10 @@ // #docplaster // #docregion // TODO SOMEDAY: Feature Componetized like HeroCenter -import {Component, OnInit} from '@angular/core'; -import {Router} from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; -import {Hero, HeroService} from './hero.service'; +import { Hero, HeroService } from './hero.service'; @Component({ // #docregion template @@ -29,7 +29,7 @@ export class HeroListComponent implements OnInit { // #enddocregion ctor ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } // #docregion select diff --git a/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts index 00361ac9fe..509761ac9b 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts @@ -6,7 +6,7 @@ import { Component } from '@angular/core'; import { OnActivate, Router, RouteSegment, RouteTree } from '@angular/router'; // #enddocregion import-router -import { Hero, HeroService} from './hero.service'; +import { Hero, HeroService } from './hero.service'; @Component({ // #docregion template diff --git a/public/docs/_examples/router/ts/app/heroes/hero.service.ts b/public/docs/_examples/router/ts/app/heroes/hero.service.ts index 7ead04d9a4..c2aec9807e 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; export class Hero { constructor(public id: number, public name: string) { } diff --git a/public/docs/_examples/router/ts/app/main.2.ts b/public/docs/_examples/router/ts/app/main.2.ts index 0740a43a08..d0600834dc 100644 --- a/public/docs/_examples/router/ts/app/main.2.ts +++ b/public/docs/_examples/router/ts/app/main.2.ts @@ -21,7 +21,7 @@ bootstrap(AppComponent, [ */ // Actually use the v.2 component -import {AppComponent as ac} from './app.component.2'; +import { AppComponent as ac } from './app.component.2'; bootstrap(ac, [ // #docregion diff --git a/public/docs/_examples/server-communication/e2e-spec.ts b/public/docs/_examples/server-communication/e2e-spec.ts index 417be6f6e8..c2c5ef9ff6 100644 --- a/public/docs/_examples/server-communication/e2e-spec.ts +++ b/public/docs/_examples/server-communication/e2e-spec.ts @@ -29,7 +29,7 @@ describe('Server Communication', function () { addButton.click().then(function() { expect(heroTags.count()).toBe(initialHeroCount, 'No new hero should be added'); }); - }) + }); it('should add a new hero to the list', function () { expect(heroNameInput).toBeDefined(' for hero name must exist'); @@ -40,7 +40,7 @@ describe('Server Communication', function () { let newHeroInList = heroTags.get(heroCountAfterAdd - 1).getText(); expect(newHeroInList).toBe(newHeroName, 'The hero should be added to the end of the list'); }); - }) + }); }); describe('Wikipedia Demo', function () { @@ -71,7 +71,7 @@ describe('Server Communication', function () { }); function testForRefreshedResult(keyPressed: string, done: () => void) { - testForResult('my-wiki', keyPressed, false, done) + testForResult('my-wiki', keyPressed, false, done); } }); @@ -102,11 +102,11 @@ describe('Server Communication', function () { function testForNewResult(keyPressed: string, done: () => void) { - testForResult('my-wiki-smart', keyPressed, false, done) + testForResult('my-wiki-smart', keyPressed, false, done); } function testForStaleResult(keyPressed: string, done: () => void) { - testForResult('my-wiki-smart', keyPressed, true, done) + testForResult('my-wiki-smart', keyPressed, true, done); } }); diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts index 7df0676a9a..f1e6450124 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts @@ -11,13 +11,12 @@ import { HeroService } from './hero.service.promise'; }) // #docregion component export class HeroListPromiseComponent implements OnInit { - - constructor (private heroService: HeroService) {} - errorMessage: string; heroes: Hero[]; mode = 'Promise'; + constructor (private heroService: HeroService) {} + ngOnInit() { this.getHeroes(); } // #docregion methods diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts index f582cfcc65..a12287dacd 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts @@ -11,13 +11,12 @@ import { HeroService } from './hero.service'; }) // #docregion component export class HeroListComponent implements OnInit { - - constructor (private heroService: HeroService) {} - errorMessage: string; heroes: Hero[]; mode = 'Observable'; + constructor (private heroService: HeroService) {} + ngOnInit() { this.getHeroes(); } // #docregion methods diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts b/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts index c3ecd07e49..6992eb5b6e 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts @@ -8,11 +8,11 @@ import { Hero } from './hero'; @Injectable() export class HeroService { - constructor (private http: Http) {} - // URL to web api private heroesUrl = 'app/heroes.json'; + constructor (private http: Http) {} + // #docregion methods getHeroes (): Promise { return this.http.get(this.heroesUrl) diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts b/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts index 63a0bc5f81..6253e0933b 100644 --- a/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts +++ b/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts @@ -20,11 +20,10 @@ import { WikipediaService } from './wikipedia.service'; providers: [JSONP_PROVIDERS, WikipediaService] }) export class WikiComponent { + items: Observable; constructor (private wikipediaService: WikipediaService) {} - items: Observable; - search (term: string) { this.items = this.wikipediaService.search(term); } diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts index f57bbf06d3..518bc2b05f 100644 --- a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts +++ b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts @@ -14,7 +14,7 @@ export class WikipediaService { // #docregion query-string let queryString = - `?search=${term}&action=opensearch&format=json&callback=JSONP_CALLBACK` + `?search=${term}&action=opensearch&format=json&callback=JSONP_CALLBACK`; return this.jsonp .get(wikiUrl + queryString) diff --git a/public/docs/_examples/structural-directives/e2e-spec.ts b/public/docs/_examples/structural-directives/e2e-spec.ts index 607990a68b..082342e413 100644 --- a/public/docs/_examples/structural-directives/e2e-spec.ts +++ b/public/docs/_examples/structural-directives/e2e-spec.ts @@ -57,9 +57,9 @@ describe('Structural Directives', function () { it('should be able to use *ngIf ', function () { let setConditionButtonEle = element.all(by.css('button')).get(0); let displayEles = element.all(by.cssContainingText('p', 'Our heroes are true!')); - expect(displayEles.count()).toBe(2, "should be displaying two ngIf elements"); + expect(displayEles.count()).toBe(2, 'should be displaying two ngIf elements'); setConditionButtonEle.click().then(function() { - expect(displayEles.count()).toBe(0, "should nog longer be displaying ngIf elements"); + expect(displayEles.count()).toBe(0, 'should nog longer be displaying ngIf elements'); }); }); }); diff --git a/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts b/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts index 8272048b96..6eaa9309e8 100644 --- a/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts +++ b/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component, Input, Output } from '@angular/core'; +import { Component, Input, OnDestroy, OnInit } from '@angular/core'; let nextId = 1; @@ -7,7 +7,7 @@ let nextId = 1; selector: 'heavy-loader', template: 'heavy loader #{{id}} on duty!' }) -export class HeavyLoaderComponent { +export class HeavyLoaderComponent implements OnDestroy, OnInit { id = nextId++; @Input() logs: string[]; diff --git a/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts b/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts index 4620905568..1e5a9ef939 100644 --- a/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts +++ b/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component, Input, Output } from '@angular/core'; +import { Component } from '@angular/core'; import { UnlessDirective } from './unless.directive'; import { HeavyLoaderComponent } from './heavy-loader.component'; @@ -18,4 +18,4 @@ export class StructuralDirectivesComponent { logs: string[] = []; status = 'ready'; } -//#enddocregion +// #enddocregion diff --git a/public/docs/_examples/style-guide/ts/01-01/app/index.ts b/public/docs/_examples/style-guide/ts/01-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/01-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/01-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/02-07/app/index.ts b/public/docs/_examples/style-guide/ts/02-07/app/index.ts index c6b22b0506..fc87f976b3 100644 --- a/public/docs/_examples/style-guide/ts/02-07/app/index.ts +++ b/public/docs/_examples/style-guide/ts/02-07/app/index.ts @@ -1,3 +1,3 @@ export * from './heroes'; export * from './users'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/02-08/app/index.ts b/public/docs/_examples/style-guide/ts/02-08/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/02-08/app/index.ts +++ b/public/docs/_examples/style-guide/ts/02-08/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-01/app/index.ts b/public/docs/_examples/style-guide/ts/03-01/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-01/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-02/app/index.ts b/public/docs/_examples/style-guide/ts/03-02/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-02/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-02/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-03/app/index.ts b/public/docs/_examples/style-guide/ts/03-03/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-03/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-04/app/index.ts b/public/docs/_examples/style-guide/ts/03-04/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-04/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-05/app/index.ts b/public/docs/_examples/style-guide/ts/03-05/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/03-05/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-05/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-06/app/index.ts b/public/docs/_examples/style-guide/ts/03-06/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/03-06/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-06/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/04-10/app/index.ts b/public/docs/_examples/style-guide/ts/04-10/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/04-10/app/index.ts +++ b/public/docs/_examples/style-guide/ts/04-10/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts b/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts index 74a83800e7..1fd2a01500 100644 --- a/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts +++ b/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { SpinnerService } from './spinner.service'; diff --git a/public/docs/_examples/style-guide/ts/04-14/app/index.ts b/public/docs/_examples/style-guide/ts/04-14/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/04-14/app/index.ts +++ b/public/docs/_examples/style-guide/ts/04-14/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-02/app/index.ts b/public/docs/_examples/style-guide/ts/05-02/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-02/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-02/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-03/app/index.ts b/public/docs/_examples/style-guide/ts/05-03/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-03/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-04/app/index.ts b/public/docs/_examples/style-guide/ts/05-04/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-04/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-12/app/index.ts b/public/docs/_examples/style-guide/ts/05-12/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-12/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-12/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-13/app/index.ts b/public/docs/_examples/style-guide/ts/05-13/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-13/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-13/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-14/app/index.ts b/public/docs/_examples/style-guide/ts/05-14/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/05-14/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-14/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-15/app/index.ts b/public/docs/_examples/style-guide/ts/05-15/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-15/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-15/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-16/app/index.ts b/public/docs/_examples/style-guide/ts/05-16/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-16/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-16/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-17/app/index.ts b/public/docs/_examples/style-guide/ts/05-17/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-17/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-17/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/06-01/app/index.ts b/public/docs/_examples/style-guide/ts/06-01/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/06-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/06-01/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/06-03/app/index.ts b/public/docs/_examples/style-guide/ts/06-03/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/06-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/06-03/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-01/app/index.ts b/public/docs/_examples/style-guide/ts/07-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-03/app/index.ts b/public/docs/_examples/style-guide/ts/07-03/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-03/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts b/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts index e938b12036..b0bc9677fe 100644 --- a/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts +++ b/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { HeroArena, HeroService, Hero } from './heroes'; @@ -8,7 +8,7 @@ import { HeroArena, HeroService, Hero } from './heroes'; template: '
{{heroes | json}}
', providers: [HeroArena, HeroService] }) -export class AppComponent { +export class AppComponent implements OnInit { heroes: Hero[] = []; constructor(private heroArena: HeroArena) { } diff --git a/public/docs/_examples/style-guide/ts/07-04/app/index.ts b/public/docs/_examples/style-guide/ts/07-04/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-04/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/09-01/app/index.ts b/public/docs/_examples/style-guide/ts/09-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/09-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/09-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/10-01/app/index.ts b/public/docs/_examples/style-guide/ts/10-01/app/index.ts index 0a909b24c9..033b419bdc 100644 --- a/public/docs/_examples/style-guide/ts/10-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/10-01/app/index.ts @@ -1,4 +1,4 @@ export * from './+dashboard'; export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/template-syntax/e2e-spec.ts b/public/docs/_examples/template-syntax/e2e-spec.ts index 48f69ba051..84522a9f03 100644 --- a/public/docs/_examples/template-syntax/e2e-spec.ts +++ b/public/docs/_examples/template-syntax/e2e-spec.ts @@ -12,14 +12,14 @@ describe('Template Syntax', function () { }); it('should be able to use interpolation with a calculation', function () { - let theSumEles = element.all(by.cssContainingText('h3~p','The sum of')); + let theSumEles = element.all(by.cssContainingText('h3~p', 'The sum of')); expect(theSumEles.count()).toBe(2); expect(theSumEles.get(0).getText()).toEqual('The sum of 1 + 1 is 2'); expect(theSumEles.get(1).getText()).toEqual('The sum of 1 + 1 is not 4'); }); it('should be able to use class binding syntax', function () { - let specialEle = element(by.cssContainingText('div','Special')); + let specialEle = element(by.cssContainingText('div', 'Special')); expect(specialEle.getAttribute('class')).toMatch('special'); }); diff --git a/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts b/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts index a7e9c7d93c..c736b85998 100644 --- a/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts +++ b/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts @@ -5,7 +5,7 @@ import { Directive, ElementRef } from '@angular/core'; // set the selector for the element type to spy on. @Directive({selector: 'select'}) export class DecoratorDirective { - constructor(el: ElementRef){ - console.log(el) + constructor(el: ElementRef) { + console.log(el); } -} \ No newline at end of file +} diff --git a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts index b613fa63b4..e5b46971fa 100644 --- a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts @@ -13,7 +13,7 @@ let nextHeroDetailId = 1; inputs: ['hero'], outputs: ['deleteRequest'], // #enddocregion input-output-2 - styles:['button { margin-left: 8px} div {margin: 8px 0} img {height:24px}'], + styles: ['button { margin-left: 8px} div {margin: 8px 0} img {height:24px}'], // #docregion template-1 template: `
@@ -28,6 +28,12 @@ let nextHeroDetailId = 1; }) // #enddocregion input-output-2 export class HeroDetailComponent { + hero: Hero = new Hero('', 'Zzzzzzzz'); // default sleeping hero + // heroImageUrl = 'http://www.wpclipart.com/cartoon/people/hero/hero_silhoutte_T.png'; + // Public Domain terms of use: http://www.wpclipart.com/terms.html + heroImageUrl = 'images/hero.png'; + lineThrough = ''; + @Input() prefix = ''; // #docregion deleteRequest // This component make a request but it can't actually delete a hero. @@ -40,13 +46,6 @@ export class HeroDetailComponent { // #docregion deleteRequest } // #enddocregion deleteRequest - - hero: Hero = new Hero('','Zzzzzzzz'); // default sleeping hero - // heroImageUrl = 'http://www.wpclipart.com/cartoon/people/hero/hero_silhoutte_T.png'; - // Public Domain terms of use: http://www.wpclipart.com/terms.html - heroImageUrl = 'images/hero.png'; - lineThrough = ''; - @Input() prefix = ''; } @Component({ diff --git a/public/docs/_examples/template-syntax/ts/app/hero.ts b/public/docs/_examples/template-syntax/ts/app/hero.ts index aca1fd5a72..ecf4d58c43 100644 --- a/public/docs/_examples/template-syntax/ts/app/hero.ts +++ b/public/docs/_examples/template-syntax/ts/app/hero.ts @@ -1,23 +1,4 @@ export class Hero { - public id:number - - constructor( - public firstName:string, - public lastName?:string, - public birthdate?:Date, - public url?:string, - public rate:number = 100, - id?:number) { - - this.id = id != null ? id : Hero.nextId++; - } - - static clone({firstName, lastName, birthdate, url, rate, id} : Hero){ - return new Hero (firstName, lastName, birthdate, url, rate, id ); - } - - get fullName() {return `${this.firstName} ${this.lastName}`;} - static nextId = 1; static MockHeroes = [ @@ -33,4 +14,23 @@ export class Hero { new Hero('Miny', 'Toe'), new Hero('Moe', 'Toe') ]; -} \ No newline at end of file + + public id: number; + + static clone({firstName, lastName, birthdate, url, rate, id}: Hero) { + return new Hero(firstName, lastName, birthdate, url, rate, id); + } + + constructor( + public firstName: string, + public lastName?: string, + public birthdate?: Date, + public url?: string, + public rate = 100, + id?: number) { + + this.id = id != null ? id : Hero.nextId++; + } + + get fullName() { return `${this.firstName} ${this.lastName}`; } +} diff --git a/public/docs/_examples/template-syntax/ts/app/main.ts b/public/docs/_examples/template-syntax/ts/app/main.ts index 19551339f8..42dbeb9f7d 100644 --- a/public/docs/_examples/template-syntax/ts/app/main.ts +++ b/public/docs/_examples/template-syntax/ts/app/main.ts @@ -2,4 +2,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; -bootstrap(AppComponent); \ No newline at end of file +bootstrap(AppComponent); diff --git a/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts b/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts index 4b2b23b5cf..e88951b2a5 100644 --- a/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts +++ b/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts @@ -1,39 +1,40 @@ // #docplaster import { Directive, ElementRef, EventEmitter, Output } from '@angular/core'; -@Directive({selector:'[myClick]'}) +@Directive({selector: '[myClick]'}) export class MyClickDirective { // #docregion my-click-output-1 @Output('myClick') clicks = new EventEmitter(); // @Output(alias) propertyName = ... // #enddocregion my-click-output-1 - constructor(el: ElementRef){ + toggle = false; + + constructor(el: ElementRef) { el.nativeElement - .addEventListener('click', (event:Event) => { + .addEventListener('click', (event: Event) => { this.toggle = !this.toggle; this.clicks.emit(this.toggle ? 'Click!' : ''); }); } - toggle = false; } // #docregion my-click-output-2 @Directive({ // #enddocregion my-click-output-2 - selector:'[myClick2]', + selector: '[myClick2]', // #docregion my-click-output-2 - outputs:['clicks:myClick'] // propertyName:alias + outputs: ['clicks:myClick'] // propertyName:alias }) // #enddocregion my-click-output-2 export class MyClickDirective2 { clicks = new EventEmitter(); + toggle = false; - constructor(el: ElementRef){ + constructor(el: ElementRef) { el.nativeElement - .addEventListener('click', (event:Event) => { + .addEventListener('click', (event: Event) => { this.toggle = !this.toggle; this.clicks.emit(this.toggle ? 'Click2!' : ''); }); } - toggle = false; } diff --git a/public/docs/_examples/testing/ts/app/app.component.spec.ts b/public/docs/_examples/testing/ts/app/app.component.spec.ts index ce17ae744a..78653e5aa5 100644 --- a/public/docs/_examples/testing/ts/app/app.component.spec.ts +++ b/public/docs/_examples/testing/ts/app/app.component.spec.ts @@ -17,7 +17,7 @@ import { Hero, HeroService, MockHeroService } from './mock-hero.service'; import { Router, MockRouter, RouterLink, MockRouterLink, - RouterOutlet, MockRouterOutlet} from './mock-router'; + RouterOutlet, MockRouterOutlet } from './mock-router'; describe('AppComponent', () => { let fixture: ComponentFixture; diff --git a/public/docs/_examples/testing/ts/app/bag.spec.ts b/public/docs/_examples/testing/ts/app/bag.spec.ts index 91e689e8b4..80790fca67 100644 --- a/public/docs/_examples/testing/ts/app/bag.spec.ts +++ b/public/docs/_examples/testing/ts/app/bag.spec.ts @@ -1,5 +1,5 @@ // Based on https://github.com/angular/angular/blob/master/modules/angular2/test/testing/testing_public_spec.ts -/* tslint:disable:no-unused-variable */ +/* tslint:disable */ import { BadTemplateUrl, ButtonComp, ChildChildComp, ChildComp, ChildWithChildComp, diff --git a/public/docs/_examples/testing/ts/app/bag.ts b/public/docs/_examples/testing/ts/app/bag.ts index 94be448e7e..26f47e8b3d 100644 --- a/public/docs/_examples/testing/ts/app/bag.ts +++ b/public/docs/_examples/testing/ts/app/bag.ts @@ -1,5 +1,5 @@ // Based on https://github.com/angular/angular/blob/master/modules/angular2/test/testing/testing_public_spec.ts -/* tslint:disable:forin */ +/* tslint:disable */ import { Component, EventEmitter, Injectable, Input, Output, Optional, OnInit, OnChanges, OnDestroy, SimpleChange } from '@angular/core'; diff --git a/public/docs/_examples/testing/ts/app/expect-proper.ts b/public/docs/_examples/testing/ts/app/expect-proper.ts index 6712b879d1..77f3deb928 100644 --- a/public/docs/_examples/testing/ts/app/expect-proper.ts +++ b/public/docs/_examples/testing/ts/app/expect-proper.ts @@ -1,5 +1,5 @@ // See https://github.com/angular/angular/issues/9017 -import { expect as expectCore} from '@angular/core/testing'; +import { expect as expectCore } from '@angular/core/testing'; import { NgMatchers } from '@angular/platform-browser/testing'; export function expect(spy: Function): NgMatchers; diff --git a/public/docs/_examples/testing/ts/app/hero-detail.component.ts b/public/docs/_examples/testing/ts/app/hero-detail.component.ts index 5cc03cff4b..3fcbf071e0 100644 --- a/public/docs/_examples/testing/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/testing/ts/app/hero-detail.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // #docplaster // #docregion // #docregion v2 diff --git a/public/docs/_examples/testing/ts/app/hero.service.ts b/public/docs/_examples/testing/ts/app/hero.service.ts index fd6d5bb128..f83588934b 100644 --- a/public/docs/_examples/testing/ts/app/hero.service.ts +++ b/public/docs/_examples/testing/ts/app/hero.service.ts @@ -13,16 +13,16 @@ export class HeroService { // See the "Take it slow" appendix getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } - //#docregion get-hero + // #docregion get-hero getHero(id: number) { return Promise.resolve(HEROES).then( heroes => heroes.filter(hero => hero.id === id)[0] ); } - //#enddocregion get-hero + // #enddocregion get-hero } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/testing/ts/app/http-hero.service.ts b/public/docs/_examples/testing/ts/app/http-hero.service.ts index 39b0991f7b..bfde5bfdc8 100644 --- a/public/docs/_examples/testing/ts/app/http-hero.service.ts +++ b/public/docs/_examples/testing/ts/app/http-hero.service.ts @@ -1,15 +1,17 @@ // #docplaster // #docregion -import {Injectable} from '@angular/core'; -import {Http, Response} from '@angular/http'; -import {Headers, RequestOptions} from '@angular/http'; -import {Hero} from './hero'; -import {Observable} from 'rxjs/Observable'; +import { Injectable } from '@angular/core'; +import { Http, Response } from '@angular/http'; +import { Headers, RequestOptions } from '@angular/http'; +import { Hero } from './hero'; +import { Observable } from 'rxjs/Observable'; @Injectable() export class HeroService { - constructor (private http: Http) {} private _heroesUrl = 'app/heroes'; // URL to web api + + constructor (private http: Http) {} + getHeroes (): Observable { return this.http.get(this._heroesUrl) .map(this.extractData) diff --git a/public/docs/_examples/testing/ts/app/mock-router.ts b/public/docs/_examples/testing/ts/app/mock-router.ts index 547629f53d..a49763f7cf 100644 --- a/public/docs/_examples/testing/ts/app/mock-router.ts +++ b/public/docs/_examples/testing/ts/app/mock-router.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ export * from '@angular/router-deprecated'; import { Directive, DynamicComponentLoader, ViewContainerRef, diff --git a/public/docs/_examples/toh-1/ts/app/app.component.ts b/public/docs/_examples/toh-1/ts/app/app.component.ts index b3cd4e8f55..73ac649198 100644 --- a/public/docs/_examples/toh-1/ts/app/app.component.ts +++ b/public/docs/_examples/toh-1/ts/app/app.component.ts @@ -10,7 +10,7 @@ export class Hero { @Component({ selector: 'my-app', - template:` + template: `

{{title}}

{{hero.name}} details!

{{hero.id}}
diff --git a/public/docs/_examples/toh-2/ts/app/app.component.ts b/public/docs/_examples/toh-2/ts/app/app.component.ts index 2dee49f08c..b883276ca5 100644 --- a/public/docs/_examples/toh-2/ts/app/app.component.ts +++ b/public/docs/_examples/toh-2/ts/app/app.component.ts @@ -8,7 +8,7 @@ export class Hero { @Component({ selector: 'my-app', - template:` + template: `

{{title}}

My Heroes

    @@ -28,7 +28,7 @@ export class Hero {
`, // #docregion styles-1 - styles:[` + styles: [` .selected { background-color: #CFD8DC !important; color: white; @@ -93,17 +93,17 @@ export class AppComponent { // #enddocregion pt2 // #docregion hero-array -var HEROES: Hero[] = [ - { "id": 11, "name": "Mr. Nice" }, - { "id": 12, "name": "Narco" }, - { "id": 13, "name": "Bombasto" }, - { "id": 14, "name": "Celeritas" }, - { "id": 15, "name": "Magneta" }, - { "id": 16, "name": "RubberMan" }, - { "id": 17, "name": "Dynama" }, - { "id": 18, "name": "Dr IQ" }, - { "id": 19, "name": "Magma" }, - { "id": 20, "name": "Tornado" } +const HEROES: Hero[] = [ + { id: 11, name: 'Mr. Nice' }, + { id: 12, name: 'Narco' }, + { id: 13, name: 'Bombasto' }, + { id: 14, name: 'Celeritas' }, + { id: 15, name: 'Magneta' }, + { id: 16, name: 'RubberMan' }, + { id: 17, name: 'Dynama' }, + { id: 18, name: 'Dr IQ' }, + { id: 19, name: 'Magma' }, + { id: 20, name: 'Tornado' } ]; // #enddocregion hero-array diff --git a/public/docs/_examples/toh-3/ts/app/app.component.ts b/public/docs/_examples/toh-3/ts/app/app.component.ts index 9fc4f99910..9ac1740f68 100644 --- a/public/docs/_examples/toh-3/ts/app/app.component.ts +++ b/public/docs/_examples/toh-3/ts/app/app.component.ts @@ -1,4 +1,4 @@ -//#docregion +// #docregion import { Component } from '@angular/core'; // #docregion hero-import @@ -11,7 +11,7 @@ import { HeroDetailComponent } from './hero-detail.component'; @Component({ selector: 'my-app', // #docregion hero-detail-template - template:` + template: `

{{title}}

My Heroes

    @@ -24,7 +24,7 @@ import { HeroDetailComponent } from './hero-detail.component'; `, // #enddocregion hero-detail-template - styles:[` + styles: [` .selected { background-color: #CFD8DC !important; color: white; @@ -85,15 +85,15 @@ export class AppComponent { onSelect(hero: Hero) { this.selectedHero = hero; } } -var HEROES: Hero[] = [ - { "id": 11, "name": "Mr. Nice" }, - { "id": 12, "name": "Narco" }, - { "id": 13, "name": "Bombasto" }, - { "id": 14, "name": "Celeritas" }, - { "id": 15, "name": "Magneta" }, - { "id": 16, "name": "RubberMan" }, - { "id": 17, "name": "Dynama" }, - { "id": 18, "name": "Dr IQ" }, - { "id": 19, "name": "Magma" }, - { "id": 20, "name": "Tornado" } +const HEROES: Hero[] = [ + { id: 11, name: 'Mr. Nice' }, + { id: 12, name: 'Narco' }, + { id: 13, name: 'Bombasto' }, + { id: 14, name: 'Celeritas' }, + { id: 15, name: 'Magneta' }, + { id: 16, name: 'RubberMan' }, + { id: 17, name: 'Dynama' }, + { id: 18, name: 'Dr IQ' }, + { id: 19, name: 'Magma' }, + { id: 20, name: 'Tornado' } ]; diff --git a/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts b/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts index 1192359265..a2f1942904 100644 --- a/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts @@ -24,15 +24,15 @@ import { Hero } from './hero'; ` // #enddocregion template -// #docregion v1 +// #docregion v1 }) export class HeroDetailComponent { // #enddocregion v1 // #docregion hero-input - @Input() -// #docregion hero + @Input() +// #docregion hero hero: Hero; -// #enddocregion hero +// #enddocregion hero // #enddocregion hero-input // #docregion v1 } diff --git a/public/docs/_examples/toh-4/ts/app/app.component.1.ts b/public/docs/_examples/toh-4/ts/app/app.component.1.ts index 42558a8a4b..42a0c8b622 100644 --- a/public/docs/_examples/toh-4/ts/app/app.component.1.ts +++ b/public/docs/_examples/toh-4/ts/app/app.component.1.ts @@ -42,7 +42,7 @@ export class AppComponent implements OnInit { // #enddocregion ctor // #docregion getHeroes getHeroes() { - //#docregion get-heroes + // #docregion get-heroes this.heroes = this.heroService.getHeroes(); // #enddocregion get-heroes } diff --git a/public/docs/_examples/toh-4/ts/app/app.component.ts b/public/docs/_examples/toh-4/ts/app/app.component.ts index 7ca63ee237..cf2b42a034 100644 --- a/public/docs/_examples/toh-4/ts/app/app.component.ts +++ b/public/docs/_examples/toh-4/ts/app/app.component.ts @@ -11,7 +11,7 @@ import { HeroService } from './hero.service'; @Component({ selector: 'my-app', // #docregion template - template:` + template: `

    {{title}}

    My Heroes

      diff --git a/public/docs/_examples/toh-4/ts/app/hero.service.ts b/public/docs/_examples/toh-4/ts/app/hero.service.ts index 943c8fe2d9..d784b43c17 100644 --- a/public/docs/_examples/toh-4/ts/app/hero.service.ts +++ b/public/docs/_examples/toh-4/ts/app/hero.service.ts @@ -18,7 +18,7 @@ export class HeroService { // #docregion get-heroes-slowly getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } // #enddocregion get-heroes-slowly diff --git a/public/docs/_examples/toh-5/e2e-spec.ts b/public/docs/_examples/toh-5/e2e-spec.ts index 4266a2b5ce..584b6ba663 100644 --- a/public/docs/_examples/toh-5/e2e-spec.ts +++ b/public/docs/_examples/toh-5/e2e-spec.ts @@ -19,19 +19,19 @@ describe('Tutorial', function () { allHeroes: element.all(by.css('my-app my-heroes li')), heroDetail: element(by.css('my-app my-hero-detail')) - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.myDashboardHref.getText()).toEqual("Dashboard"); - expect(page.myHeroesHref.getText()).toEqual("Heroes"); + expect(page.myDashboardHref.getText()).toEqual('Dashboard'); + expect(page.myHeroesHref.getText()).toEqual('Heroes'); }); it('should be able to see dashboard choices', function () { let page = getPageStruct(); - expect(page.topHeroes.count()).toBe(4, "should be 4 dashboard hero choices"); + expect(page.topHeroes.count()).toBe(4, 'should be 4 dashboard hero choices'); }); it('should be able to toggle the views', function () { @@ -40,7 +40,7 @@ describe('Tutorial', function () { expect(page.myDashboardParent.element(by.css('h3')).getText()).toEqual('Top Heroes'); page.myHeroesHref.click().then(function() { expect(page.myDashboardParent.isPresent()).toBe(false, 'should no longer see dashboard element'); - expect(page.allHeroes.count()).toBeGreaterThan(4, "should be more than 4 heroes shown"); + expect(page.allHeroes.count()).toBeGreaterThan(4, 'should be more than 4 heroes shown'); return page.myDashboardHref.click(); }).then(function() { expect(page.myDashboardParent.isPresent()).toBe(true, 'should once again see the dashboard element'); @@ -79,7 +79,7 @@ describe('Tutorial', function () { return heroEle.getText(); }).then(function(text) { // remove leading 'id' from the element - heroDescr = text.substr(text.indexOf(' ')+1); + heroDescr = text.substr(text.indexOf(' ') + 1); return heroEle.click(); }).then(function() { expect(viewDetailsButtonEle.isDisplayed()).toBe(true, 'viewDetails button should now be visible'); diff --git a/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts b/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts index 3825a7625c..2d51b37007 100644 --- a/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts +++ b/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts @@ -19,9 +19,9 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } - gotoDetail(){ /* not implemented yet */} + gotoDetail() { /* not implemented yet */} } // #enddocregion component diff --git a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts index 64489ff312..3d54f5ab4b 100644 --- a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts +++ b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts @@ -31,7 +31,7 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } // #docregion goto-detail @@ -41,4 +41,4 @@ export class DashboardComponent implements OnInit { } // #enddocregion goto-detail } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/toh-5/ts/app/hero.service.ts b/public/docs/_examples/toh-5/ts/app/hero.service.ts index efc348509b..9bae27f006 100644 --- a/public/docs/_examples/toh-5/ts/app/hero.service.ts +++ b/public/docs/_examples/toh-5/ts/app/hero.service.ts @@ -13,15 +13,15 @@ export class HeroService { // See the "Take it slow" appendix getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } - //#docregion get-hero + // #docregion get-hero getHero(id: number) { return this.getHeroes() .then(heroes => heroes.filter(hero => hero.id === id)[0]); } - //#enddocregion get-hero + // #enddocregion get-hero } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/toh-6/e2e-spec.ts b/public/docs/_examples/toh-6/e2e-spec.ts index bec10800b4..faf5787bae 100644 --- a/public/docs/_examples/toh-6/e2e-spec.ts +++ b/public/docs/_examples/toh-6/e2e-spec.ts @@ -37,7 +37,7 @@ describe('TOH Http Chapter', function () { }).then(function() { return page.addButton.click(); }).then(function(){ - return save(page,'','The New Hero'); + return save(page, '', 'The New Hero'); }).then(function(){ browser.waitForAngular(); diff --git a/public/docs/_examples/toh-6/ts/app/dashboard.component.ts b/public/docs/_examples/toh-6/ts/app/dashboard.component.ts index 988d51fee9..8ca1e3a2e2 100644 --- a/public/docs/_examples/toh-6/ts/app/dashboard.component.ts +++ b/public/docs/_examples/toh-6/ts/app/dashboard.component.ts @@ -22,7 +22,7 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } gotoDetail(hero: Hero) { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts index 2e2b7b5b54..b4926d8c69 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; // #docregion bootstrap import { UpgradeAdapter } from '@angular/upgrade'; diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts index f7e1ba4b13..fdcba54580 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts @@ -3,7 +3,7 @@ import { upgradeAdapter } from './upgrade_adapter'; // #enddocregion bootstrap -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts index c4b56a5ca6..7b9d8c8dab 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts index 427c605de3..37241e1a07 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts index 2534ebd99a..ad48568e09 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts @@ -3,7 +3,7 @@ import { UpgradeAdapter } from '@angular/upgrade'; import { MainController } from './main.controller'; import { HeroDetailComponent } from './hero-detail.component'; -declare var angular:any; +declare var angular: any; const upgradeAdapter = new UpgradeAdapter(); angular.module('heroApp', []) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts index a38d87d6f5..7ae5fd331d 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts @@ -2,7 +2,7 @@ import { HeroDetailComponent } from './hero-detail.component'; import { HeroesService } from './heroes.service'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; // #docregion register angular.module('heroApp', []) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts index fa1c26a9fa..3ad50cd961 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts @@ -10,8 +10,8 @@ import { Hero } from '../hero'; ` }) export class HeroDetailComponent { - hero:Hero; - constructor(@Inject('heroes') heroes:HeroesService) { + hero: Hero; + constructor(@Inject('heroes') heroes: HeroesService) { this.hero = heroes.get()[0]; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts index 657c4d25cc..9ab3f70e94 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts @@ -2,14 +2,14 @@ import { heroDetailComponent } from './hero-detail.component'; import { Heroes } from './heroes'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; // #docregion register upgradeAdapter.addProvider(Heroes); angular.module('heroApp', []) .factory('heroes', upgradeAdapter.downgradeNg2Provider(Heroes)) - .component('heroDetail', heroDetailComponent) + .component('heroDetail', heroDetailComponent); // #enddocregion register upgradeAdapter.bootstrap( diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts index d736117ce0..dd7aa10d79 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts @@ -5,7 +5,7 @@ export const heroDetailComponent = { template: `

      {{$ctrl.hero.id}}: {{$ctrl.hero.name}}

      `, - controller: ['heroes', function(heroes:Heroes) { + controller: ['heroes', function(heroes: Heroes) { this.hero = heroes.get()[0]; }] }; diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts index ab16d3a24d..426d718c38 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts @@ -3,11 +3,11 @@ import { ContainerComponent } from './container.component'; import { heroDetailComponent } from './hero-detail.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .directive('myContainer', upgradeAdapter.downgradeNg2Component(ContainerComponent)) - .component('heroDetail', heroDetailComponent) + .component('heroDetail', heroDetailComponent); upgradeAdapter.bootstrap( document.querySelector('hero-app'), diff --git a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts index 12879ac980..94082813fd 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts @@ -1,6 +1,6 @@ // #docregion import { Component, EventEmitter, Input, Output } from '@angular/core'; -import {Hero} from '../hero'; +import { Hero } from '../hero'; @Component({ selector: 'hero-detail', @@ -11,7 +11,7 @@ import {Hero} from '../hero'; ` }) export class HeroDetailComponent { - @Input() hero:Hero + @Input() hero: Hero; @Output() deleted = new EventEmitter(); onDelete() { this.deleted.emit(this.hero); diff --git a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts index 2ce02c8792..d50272073f 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts @@ -5,8 +5,8 @@ export class MainController { heroes = [ new Hero(2, 'Superman'), new Hero(3, 'Spiderman') - ] - onDelete(hero:Hero) { + ]; + onDelete(hero: Hero) { hero.name = 'Ex-' + hero.name; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts b/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts index 8f595ba38f..e1b14d2dfc 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts @@ -18,5 +18,5 @@ export function heroDetailDirective() { }; }, controllerAs: 'ctrl' - } + }; } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/hero.ts b/public/docs/_examples/upgrade-adapter/ts/app/hero.ts index 172d393139..5dcb5664eb 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/hero.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/hero.ts @@ -1,5 +1,5 @@ export class Hero { - constructor(public id:number, - public name:string, - public description?:string) { } + constructor(public id: number, + public name: string, + public description?: string) { } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts index dd2df20bdf..7e672c888c 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts @@ -3,7 +3,7 @@ import { ContainerComponent } from './container.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .component('heroDetail', heroDetail) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts index 692e3f206f..0055370ea8 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts @@ -17,7 +17,7 @@ const HeroDetail = upgradeAdapter.upgradeNg1Component('heroDetail'); }) export class ContainerComponent { hero = new Hero(1, 'Windstorm'); - heroDeleted(hero:Hero) { + heroDeleted(hero: Hero) { hero.name = 'Ex-' + hero.name; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts index dd2df20bdf..7e672c888c 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts @@ -3,7 +3,7 @@ import { ContainerComponent } from './container.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .component('heroDetail', heroDetail) diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts index 4af94f3d37..f0739b6405 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts @@ -9,7 +9,7 @@ angular. }; function animateIn(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ display: 'block', @@ -21,12 +21,12 @@ angular. }, done); return function animateInEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } function animateOut(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ position: 'absolute', @@ -37,7 +37,7 @@ angular. }, done); return function animateOutEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } }); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts index 57f37b9d1f..1d16f67fbe 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts @@ -1,7 +1,7 @@ // #docregion angular. module('phonecatApp'). - config(['$locationProvider' ,'$routeProvider', + config(['$locationProvider', '$routeProvider', function config($locationProvider: angular.ILocationProvider, $routeProvider: angular.route.IRouteProvider) { $locationProvider.hashPrefix('!'); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts index 3b6962dd59..312036d71d 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts @@ -1,8 +1,8 @@ 'use strict'; describe('Phone', () => { - let $httpBackend:angular.IHttpBackendService; - let Phone:any; + let $httpBackend: angular.IHttpBackendService; + let Phone: any; let phonesData = [ {name: 'Phone X'}, {name: 'Phone Y'}, @@ -18,7 +18,7 @@ describe('Phone', () => { beforeEach(angular.mock.module('core.phone')); // Instantiate the service and "train" `$httpBackend` before each test - beforeEach(inject(function(_$httpBackend_:angular.IHttpBackendService, _Phone_:any) { + beforeEach(inject(function(_$httpBackend_: angular.IHttpBackendService, _Phone_: any) { $httpBackend = _$httpBackend_; $httpBackend.expectGET('phones/phones.json').respond(phonesData); @@ -32,7 +32,7 @@ describe('Phone', () => { }); it('should fetch the phones data from `/phones/phones.json`', () => { - var phones = Phone.query(); + let phones = Phone.query(); expect(phones).toEqual([]); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts index 15ff4a2464..0998b638f0 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts @@ -6,7 +6,7 @@ describe('phoneDetail', () => { // Test the controller describe('PhoneDetailController', () => { - let $httpBackend: angular.IHttpBackendService + let $httpBackend: angular.IHttpBackendService; let ctrl: any; let xyzPhoneData = { name: 'phone xyz', diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts index 4af94f3d37..f0739b6405 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts @@ -9,7 +9,7 @@ angular. }; function animateIn(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ display: 'block', @@ -21,12 +21,12 @@ angular. }, done); return function animateInEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } function animateOut(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ position: 'absolute', @@ -37,7 +37,7 @@ angular. }, done); return function animateOutEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } }); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts index 72bbb2de49..458ed94250 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts @@ -2,8 +2,8 @@ angular. module('phonecatApp'). - config(['$locationProvider' ,'$routeProvider', - function config($locationProvider:angular.ILocationProvider, + config(['$locationProvider', '$routeProvider', + function config($locationProvider: angular.ILocationProvider, $routeProvider: angular.route.IRouteProvider) { $locationProvider.hashPrefix('!'); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts index 9fe842a4e4..2849dfa8b0 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts @@ -16,13 +16,13 @@ import { MockBackend, MockConnection } from '@angular/http/testing'; import { Phone, PhoneData } from './phone.service'; describe('Phone', function() { - let phone:Phone; - let phonesData:PhoneData[] = [ + let phone: Phone; + let phonesData: PhoneData[] = [ {name: 'Phone X', snippet: '', images: []}, {name: 'Phone Y', snippet: '', images: []}, {name: 'Phone Z', snippet: '', images: []} ]; - let mockBackend:MockBackend; + let mockBackend: MockBackend; beforeEachProviders(() => [ Phone, @@ -36,7 +36,7 @@ describe('Phone', function() { ]); beforeEach(inject([MockBackend, Phone], - (_mockBackend_:MockBackend, _phone_:Phone) => { + (_mockBackend_: MockBackend, _phone_: Phone) => { mockBackend = _mockBackend_; phone = _phone_; })); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts index 67809b486a..6affef51de 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts @@ -17,16 +17,16 @@ import { import { PhoneDetailComponent } from './phone-detail.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; -function xyzPhoneData():PhoneData { +function xyzPhoneData(): PhoneData { return { name: 'phone xyz', snippet: '', images: ['image/url1.png', 'image/url2.png'] - } + }; } class MockPhone extends Phone { - get(id: string):Observable { + get(id: string): Observable { return Observable.of(xyzPhoneData()); } } diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts index 3f42ba3044..bae7fd2ecf 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts @@ -15,7 +15,7 @@ import { CheckmarkPipe } from '../core/checkmark/checkmark.pipe'; // #docregion initialclass }) // #enddocregion checkmark-pipe -export class PhoneDetailComponent{ +export class PhoneDetailComponent { phone: PhoneData; mainImageUrl: string; diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts index d050615923..80c1a39e9f 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts @@ -17,14 +17,14 @@ import { PhoneListComponent } from './phone-list.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; class MockPhone extends Phone { - query():Observable { + query(): Observable { console.log('mocking here'); return Observable.of( [ {name: 'Nexus S', snippet: '', images: []}, {name: 'Motorola DROID', snippet: '', images: []} ] - ) + ); } } diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts index a8b16c123f..5acd35758b 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts @@ -9,7 +9,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; }) export class PhoneListComponent { phones: PhoneData[]; - query:string; + query: string; orderProp: string; constructor(phone: Phone) { @@ -21,7 +21,7 @@ export class PhoneListComponent { // #enddocregion initialclass // #docregion getphones - getPhones():PhoneData[] { + getPhones(): PhoneData[] { return this.sortPhones(this.filterPhones(this.phones)); } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts index 8f7ebd2ef4..af4e91c80f 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts @@ -5,9 +5,9 @@ import { PhoneListComponent } from './phone-list/phone-list.component'; import { PhoneDetailComponent } from './phone-detail/phone-detail.component'; @RouteConfig([ - {path:'/phones', name: 'Phones', component: PhoneListComponent}, - {path:'/phones/:phoneId', name: 'Phone', component: PhoneDetailComponent}, - {path:'/', redirectTo: ['Phones']} + {path: '/phones', name: 'Phones', component: PhoneListComponent}, + {path: '/phones/:phoneId', name: 'Phone', component: PhoneDetailComponent}, + {path: '/', redirectTo: ['Phones']} ]) @Component({ selector: 'phonecat-app', diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts index ab664dc4c8..c9f511913b 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts @@ -15,13 +15,13 @@ import { MockBackend, MockConnection } from '@angular/http/testing'; import { Phone, PhoneData } from './phone.service'; describe('Phone', function() { - let phone:Phone; - let phonesData:PhoneData[] = [ + let phone: Phone; + let phonesData: PhoneData[] = [ {name: 'Phone X', snippet: '', images: []}, {name: 'Phone Y', snippet: '', images: []}, {name: 'Phone Z', snippet: '', images: []} ]; - let mockBackend:MockBackend; + let mockBackend: MockBackend; beforeEachProviders(() => [ Phone, @@ -33,7 +33,7 @@ describe('Phone', function() { } ]); - beforeEach(inject([MockBackend, Phone], (_mockBackend_:MockBackend, _phone_:Phone) => { + beforeEach(inject([MockBackend, Phone], (_mockBackend_: MockBackend, _phone_: Phone) => { mockBackend = _mockBackend_; phone = _phone_; })); diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts index c553df3d29..79b3cddcfb 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts @@ -21,16 +21,16 @@ import { import { PhoneDetailComponent } from './phone-detail.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; -function xyzPhoneData():PhoneData { +function xyzPhoneData(): PhoneData { return { name: 'phone xyz', snippet: '', images: ['image/url1.png', 'image/url2.png'] - } + }; } class MockPhone extends Phone { - get(id: string):Observable { + get(id: string): Observable { return Observable.of(xyzPhoneData()); } } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts index 5e29057023..36db78632c 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts @@ -10,7 +10,7 @@ import { CheckmarkPipe } from '../core/checkmark/checkmark.pipe'; templateUrl: 'phone-detail/phone-detail.template.html', pipes: [ CheckmarkPipe ] }) -export class PhoneDetailComponent{ +export class PhoneDetailComponent { phone: PhoneData; mainImageUrl: string; diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts index bfdde7e1fc..3e0f5f1943 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts @@ -1,6 +1,6 @@ // #docregion routestuff import { ApplicationRef } from '@angular/core'; -import { LocationStrategy, HashLocationStrategy } from '@angular/common'; +import { LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; import { ROUTER_PROVIDERS, @@ -29,11 +29,11 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; class MockPhone extends Phone { - query():Observable { + query(): Observable { return Observable.of([ {name: 'Nexus S', snippet: '', images: []}, {name: 'Motorola DROID', snippet: '', images: []} - ]) + ]); } } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts index 1ea6219031..352c433838 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts @@ -12,7 +12,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; // #enddocregion top export class PhoneListComponent { phones: PhoneData[]; - query:string; + query: string; orderProp: string; constructor(phone: Phone) { @@ -24,7 +24,7 @@ export class PhoneListComponent { // #enddocregion initialclass // #docregion getphones - getPhones():PhoneData[] { + getPhones(): PhoneData[] { return this.sortPhones(this.filterPhones(this.phones)); } diff --git a/public/docs/_examples/user-input/e2e-spec.ts b/public/docs/_examples/user-input/e2e-spec.ts index 22f8d96f63..a57a6ab33c 100644 --- a/public/docs/_examples/user-input/e2e-spec.ts +++ b/public/docs/_examples/user-input/e2e-spec.ts @@ -20,7 +20,7 @@ describe('User Input Tests', function () { expect(mainEle.getText()).not.toContain('Event target is '); buttonEle.click().then(function() { expect(mainEle.getText()).toContain('Event target is BUTTON'); - }) + }); }); it('should support the keyup event ', function () { @@ -28,7 +28,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('a | ab | abc |'); }); }); @@ -38,7 +38,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('abc'); }); }); @@ -48,7 +48,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('a | ab | abc |'); }); }); @@ -58,7 +58,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet'); return sendKeys(inputEle, protractor.Key.ENTER); }).then(function() { @@ -72,7 +72,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet'); // change the focus return prevInputEle.click(); diff --git a/public/docs/_examples/user-input/ts/app/click-me.component.ts b/public/docs/_examples/user-input/ts/app/click-me.component.ts index 20e77ad427..45a4ca7e70 100644 --- a/public/docs/_examples/user-input/ts/app/click-me.component.ts +++ b/public/docs/_examples/user-input/ts/app/click-me.component.ts @@ -17,8 +17,8 @@ import { Component } from '@angular/core'; export class ClickMeComponent { clickMessage = ''; - onClickMe(){ - this.clickMessage ='You are my hero!'; + onClickMe() { + this.clickMessage = 'You are my hero!'; } } // #enddocregion click-me-component diff --git a/public/docs/_examples/user-input/ts/app/click-me2.component.ts b/public/docs/_examples/user-input/ts/app/click-me2.component.ts index b444e3594e..efd3be2753 100644 --- a/public/docs/_examples/user-input/ts/app/click-me2.component.ts +++ b/public/docs/_examples/user-input/ts/app/click-me2.component.ts @@ -11,8 +11,8 @@ export class ClickMeComponent2 { clickMessage = ''; clicks = 1; - onClickMe2(event:any){ - let evtMsg = event ? ' Event target is '+ event.target.tagName : ''; - this.clickMessage = (`Click #${this.clicks++}. ${evtMsg}`) + onClickMe2(event: any) { + let evtMsg = event ? ' Event target is ' + event.target.tagName : ''; + this.clickMessage = (`Click #${this.clicks++}. ${evtMsg}`); } } diff --git a/public/docs/_examples/user-input/ts/app/keyup.components.ts b/public/docs/_examples/user-input/ts/app/keyup.components.ts index c4acf742f5..79736c8a4c 100644 --- a/public/docs/_examples/user-input/ts/app/keyup.components.ts +++ b/public/docs/_examples/user-input/ts/app/keyup.components.ts @@ -1,3 +1,4 @@ +/* tslint:disable:class-name component-class-suffix */ // #docplaster // #docregion import { Component } from '@angular/core'; @@ -14,7 +15,7 @@ import { Component } from '@angular/core'; }) // #docregion key-up-component-1-class, key-up-component-1-class-no-type export class KeyUpComponent_v1 { - values=''; + values = ''; // #enddocregion key-up-component-1-class, key-up-component-1-class-no-type /* @@ -27,7 +28,7 @@ export class KeyUpComponent_v1 { */ // #docregion key-up-component-1-class // with strong typing - onKey(event:KeyboardEvent) { + onKey(event: KeyboardEvent) { this.values += (event.target).value + ' | '; } // #docregion key-up-component-1-class-no-type @@ -45,8 +46,8 @@ export class KeyUpComponent_v1 { ` }) export class KeyUpComponent_v2 { - values=''; - onKey(value:string) { + values = ''; + onKey(value: string) { this.values += value + ' | '; } } @@ -64,7 +65,7 @@ export class KeyUpComponent_v2 { ` }) export class KeyUpComponent_v3 { - values=''; + values = ''; } // #enddocregion key-up-component-3 @@ -83,6 +84,6 @@ export class KeyUpComponent_v3 { ` }) export class KeyUpComponent_v4 { - values=''; + values = ''; } // #enddocregion key-up-component-4 diff --git a/public/docs/_examples/user-input/ts/app/little-tour.component.ts b/public/docs/_examples/user-input/ts/app/little-tour.component.ts index f48abe3518..8dd3ebf216 100644 --- a/public/docs/_examples/user-input/ts/app/little-tour.component.ts +++ b/public/docs/_examples/user-input/ts/app/little-tour.component.ts @@ -15,8 +15,8 @@ import { Component } from '@angular/core'; ` }) export class LittleTourComponent { - heroes=['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; - addHero(newHero:string) { + heroes = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; + addHero(newHero: string) { if (newHero) { this.heroes.push(newHero); } diff --git a/public/docs/_examples/user-input/ts/app/loop-back.component.ts b/public/docs/_examples/user-input/ts/app/loop-back.component.ts index f7c15f36bf..6c9dad1da8 100644 --- a/public/docs/_examples/user-input/ts/app/loop-back.component.ts +++ b/public/docs/_examples/user-input/ts/app/loop-back.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; // #docregion loop-back-component @Component({ selector: 'loop-back', - template:` + template: `

      {{box.value}}

      ` diff --git a/tslint.json b/tslint.json index 490c4bd51d..0455f476ed 100644 --- a/tslint.json +++ b/tslint.json @@ -102,6 +102,7 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true + "directive-class-suffix": true, + "import-destructuring-spacing": true } } From fb49cbe33f9d63d9f5bd258eebf7588e9cd42f62 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 5 Jun 2016 20:25:16 +0200 Subject: [PATCH 0006/1217] docs(cli-quickstart): add cli 5 min quickstart closes #1606 --- gulpfile.js | 16 +- .../docs/_examples/cli-quickstart/e2e-spec.ts | 11 + .../_examples/cli-quickstart/ts/.gitignore | 38 +++ .../cli-quickstart/ts/angular-cli-build.js | 17 ++ .../cli-quickstart/ts/angular-cli.json | 31 ++ .../ts/config/environment.dev.ts | 3 + .../cli-quickstart/ts/config/environment.js | 10 + .../ts/config/environment.prod.ts | 3 + .../cli-quickstart/ts/config/karma.conf.js | 42 +++ .../ts/config/protractor.conf.js | 29 ++ .../cli-quickstart/ts/e2e/app.e2e.ts | 14 + .../_examples/cli-quickstart/ts/e2e/app.po.ts | 9 + .../cli-quickstart/ts/example-config.json | 0 .../cli-quickstart/ts/public/.npmignore | 0 .../ts/src/app/cli-quickstart.component.css | 6 + .../ts/src/app/cli-quickstart.component.html | 2 + .../src/app/cli-quickstart.component.spec.ts | 22 ++ .../ts/src/app/cli-quickstart.component.ts | 17 ++ .../cli-quickstart/ts/src/app/environment.ts | 7 + .../cli-quickstart/ts/src/app/index.ts | 2 + .../cli-quickstart/ts/src/app/shared/index.ts | 0 .../cli-quickstart/ts/src/favicon.ico | Bin 0 -> 5430 bytes .../cli-quickstart/ts/src/index.html | 35 +++ .../_examples/cli-quickstart/ts/src/main.ts | 18 ++ .../cli-quickstart/ts/src/system-config.ts | 54 ++++ .../cli-quickstart/ts/src/typings.d.ts | 1 + public/docs/_examples/package.json | 7 +- public/docs/ts/latest/_data.json | 7 + public/docs/ts/latest/cli-quickstart.jade | 278 ++++++++++++++++++ .../devguide/cli-quickstart/app-works.png | Bin 0 -> 15107 bytes .../devguide/cli-quickstart/my-first-app.png | Bin 0 -> 12797 bytes 31 files changed, 672 insertions(+), 7 deletions(-) create mode 100644 public/docs/_examples/cli-quickstart/e2e-spec.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/.gitignore create mode 100644 public/docs/_examples/cli-quickstart/ts/angular-cli-build.js create mode 100644 public/docs/_examples/cli-quickstart/ts/angular-cli.json create mode 100644 public/docs/_examples/cli-quickstart/ts/config/environment.dev.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/config/environment.js create mode 100644 public/docs/_examples/cli-quickstart/ts/config/environment.prod.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/config/karma.conf.js create mode 100644 public/docs/_examples/cli-quickstart/ts/config/protractor.conf.js create mode 100644 public/docs/_examples/cli-quickstart/ts/e2e/app.e2e.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/e2e/app.po.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/example-config.json create mode 100644 public/docs/_examples/cli-quickstart/ts/public/.npmignore create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.css create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.html create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.spec.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/environment.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/index.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/app/shared/index.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/favicon.ico create mode 100644 public/docs/_examples/cli-quickstart/ts/src/index.html create mode 100644 public/docs/_examples/cli-quickstart/ts/src/main.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/system-config.ts create mode 100644 public/docs/_examples/cli-quickstart/ts/src/typings.d.ts create mode 100644 public/docs/ts/latest/cli-quickstart.jade create mode 100644 public/resources/images/devguide/cli-quickstart/app-works.png create mode 100644 public/resources/images/devguide/cli-quickstart/my-first-app.png diff --git a/gulpfile.js b/gulpfile.js index a8e7e67e04..dd0eebb235 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -221,11 +221,19 @@ function findAndRunE2eTests(filter, outputFile) { // fileName; then shut down the example. All protractor output is appended // to the outputFile. function runE2eTsTests(appDir, outputFile) { - // start the app - var appRunSpawnInfo = spawnExt('npm',['run','http-server:e2e', '--', '-s' ], { cwd: appDir }); - var tscRunSpawnInfo = spawnExt('npm',['run','tsc'], { cwd: appDir }); + // spawn tasks to start the app + var appBuildSpawnInfo; + var appRunSpawnInfo; - return runProtractor(tscRunSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile); + if (fs.existsSync(path.join(appDir, 'angular-cli.json'))) { + appBuildSpawnInfo = spawnExt('npm', ['run', 'build:cli'], { cwd: appDir }); + appRunSpawnInfo = spawnExt('npm', ['run', 'http-server:cli', '--', '-s'], { cwd: appDir }); + } else { + appBuildSpawnInfo = spawnExt('npm',['run','tsc'], { cwd: appDir }); + appRunSpawnInfo = spawnExt('npm',['run','http-server:e2e', '--', '-s' ], { cwd: appDir }); + } + + return runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile); } function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) { diff --git a/public/docs/_examples/cli-quickstart/e2e-spec.ts b/public/docs/_examples/cli-quickstart/e2e-spec.ts new file mode 100644 index 0000000000..4134ed74a1 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/e2e-spec.ts @@ -0,0 +1,11 @@ +/// +describe('cli-quickstart App', () => { + beforeEach(() => { + return browser.get('/'); + }) + + it('should display message saying app works', () => { + var pageTitle = element(by.css('cli-quickstart-app h1')).getText() + expect(pageTitle).toEqual('My First Angular 2 App'); + }); +}); diff --git a/public/docs/_examples/cli-quickstart/ts/.gitignore b/public/docs/_examples/cli-quickstart/ts/.gitignore new file mode 100644 index 0000000000..766f37285b --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/.gitignore @@ -0,0 +1,38 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp + +# dependencies +/node_modules +/bower_components + +# IDEs and editors +/.idea + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store +Thumbs.db + +# angular.io overrides +!angular-cli.json +!angular-cli-build.js +!config/environment.js +!config/karma-test.js +!config/karma.conf.js +!config/protractor.conf.js +!src/typings.d.ts diff --git a/public/docs/_examples/cli-quickstart/ts/angular-cli-build.js b/public/docs/_examples/cli-quickstart/ts/angular-cli-build.js new file mode 100644 index 0000000000..dad887ff3d --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/angular-cli-build.js @@ -0,0 +1,17 @@ +/* global require, module */ + +var Angular2App = require('angular-cli/lib/broccoli/angular2-app'); + +module.exports = function(defaults) { + return new Angular2App(defaults, { + vendorNpmFiles: [ + 'systemjs/dist/system-polyfills.js', + 'systemjs/dist/system.src.js', + 'zone.js/dist/**/*.+(js|js.map)', + 'es6-shim/es6-shim.js', + 'reflect-metadata/**/*.+(js|js.map)', + 'rxjs/**/*.+(js|js.map)', + '@angular/**/*.+(js|js.map)' + ] + }); +}; diff --git a/public/docs/_examples/cli-quickstart/ts/angular-cli.json b/public/docs/_examples/cli-quickstart/ts/angular-cli.json new file mode 100644 index 0000000000..16964f2477 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/angular-cli.json @@ -0,0 +1,31 @@ +{ + "project": { + "version": "1.0.0-beta.5", + "name": "cli-quickstart" + }, + "apps": [ + { + "main": "src/main.ts", + "tsconfig": "src/tsconfig.json", + "mobile": false + } + ], + "addons": [], + "packages": [], + "e2e": { + "protractor": { + "config": "config/protractor.conf.js" + } + }, + "test": { + "karma": { + "config": "config/karma.conf.js" + } + }, + "defaults": { + "prefix": "app", + "sourceDir": "src", + "styleExt": "css", + "prefixInterfaces": false + } +} diff --git a/public/docs/_examples/cli-quickstart/ts/config/environment.dev.ts b/public/docs/_examples/cli-quickstart/ts/config/environment.dev.ts new file mode 100644 index 0000000000..ffe8aed766 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/config/environment.dev.ts @@ -0,0 +1,3 @@ +export const environment = { + production: false +}; diff --git a/public/docs/_examples/cli-quickstart/ts/config/environment.js b/public/docs/_examples/cli-quickstart/ts/config/environment.js new file mode 100644 index 0000000000..4fa28880da --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/config/environment.js @@ -0,0 +1,10 @@ +/* jshint node: true */ + +module.exports = function(environment) { + return { + environment: environment, + baseURL: '/', + locationType: 'auto' + }; +}; + diff --git a/public/docs/_examples/cli-quickstart/ts/config/environment.prod.ts b/public/docs/_examples/cli-quickstart/ts/config/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/config/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/public/docs/_examples/cli-quickstart/ts/config/karma.conf.js b/public/docs/_examples/cli-quickstart/ts/config/karma.conf.js new file mode 100644 index 0000000000..d39036fa52 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/config/karma.conf.js @@ -0,0 +1,42 @@ +module.exports = function (config) { + config.set({ + basePath: '..', + frameworks: ['jasmine'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher') + ], + customLaunchers: { + // chrome setup for travis CI using chromium + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + files: [ + { pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false }, + { pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false }, + { pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false }, + { pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false }, + { pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false }, + { pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false }, + + { pattern: 'config/karma-test-shim.js', included: true, watched: true }, + + // Distribution folder. + { pattern: 'dist/**/*', included: false, watched: true } + ], + exclude: [ + // Vendor packages might include spec files. We don't want to use those. + 'dist/vendor/**/*.spec.js' + ], + preprocessors: {}, + reporters: ['progress'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/public/docs/_examples/cli-quickstart/ts/config/protractor.conf.js b/public/docs/_examples/cli-quickstart/ts/config/protractor.conf.js new file mode 100644 index 0000000000..57f4f87dd7 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/config/protractor.conf.js @@ -0,0 +1,29 @@ +/*global jasmine */ +var SpecReporter = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + '../e2e/**/*.e2e.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + useAllAngular2AppRoots: true, + beforeLaunch: function() { + require('ts-node').register({ + project: 'e2e' + }); + }, + onPrepare: function() { + jasmine.getEnv().addReporter(new SpecReporter()); + } +}; diff --git a/public/docs/_examples/cli-quickstart/ts/e2e/app.e2e.ts b/public/docs/_examples/cli-quickstart/ts/e2e/app.e2e.ts new file mode 100644 index 0000000000..130d236c1c --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/e2e/app.e2e.ts @@ -0,0 +1,14 @@ +import { CliQuickstartPage } from './app.po'; + +describe('cli-quickstart App', function() { + let page: CliQuickstartPage; + + beforeEach(() => { + page = new CliQuickstartPage(); + }); + + it('should display message saying app works', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('cli-quickstart works!'); + }); +}); diff --git a/public/docs/_examples/cli-quickstart/ts/e2e/app.po.ts b/public/docs/_examples/cli-quickstart/ts/e2e/app.po.ts new file mode 100644 index 0000000000..645e0e83a8 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/e2e/app.po.ts @@ -0,0 +1,9 @@ +export class CliQuickstartPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('cli-quickstart-app h1')).getText(); + } +} diff --git a/public/docs/_examples/cli-quickstart/ts/example-config.json b/public/docs/_examples/cli-quickstart/ts/example-config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/cli-quickstart/ts/public/.npmignore b/public/docs/_examples/cli-quickstart/ts/public/.npmignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.css b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.css new file mode 100644 index 0000000000..a2b21fae82 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.css @@ -0,0 +1,6 @@ +/* #docregion */ +h1 { + color: #369; + font-family: Arial, Helvetica, sans-serif; + font-size: 250%; +} diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.html b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.html new file mode 100644 index 0000000000..009d49dfa6 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.html @@ -0,0 +1,2 @@ + +

      {{title}}

      diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.spec.ts b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.spec.ts new file mode 100644 index 0000000000..90abbf1298 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.spec.ts @@ -0,0 +1,22 @@ +import { + beforeEachProviders, + describe, + expect, + it, + inject +} from '@angular/core/testing'; +import { CliQuickstartAppComponent } from '../app/cli-quickstart.component'; + +beforeEachProviders(() => [CliQuickstartAppComponent]); + +describe('App: CliQuickstart', () => { + it('should create the app', + inject([CliQuickstartAppComponent], (app: CliQuickstartAppComponent) => { + expect(app).toBeTruthy(); + })); + + it('should have as title \'cli-quickstart works!\'', + inject([CliQuickstartAppComponent], (app: CliQuickstartAppComponent) => { + expect(app.title).toEqual('cli-quickstart works!'); + })); +}); diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.ts b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.ts new file mode 100644 index 0000000000..5510df7476 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/cli-quickstart.component.ts @@ -0,0 +1,17 @@ +// #docregion import +import { Component } from '@angular/core'; +// #enddocregion import + +// #docregion metadata +@Component({ + moduleId: module.id, + selector: 'cli-quickstart-app', + templateUrl: 'cli-quickstart.component.html', + styleUrls: ['cli-quickstart.component.css'] +}) +// #enddocregion metadata +// #docregion title, class +export class CliQuickstartAppComponent { + title = 'My First Angular 2 App'; +} +// #enddocregion title, class diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/environment.ts b/public/docs/_examples/cli-quickstart/ts/src/app/environment.ts new file mode 100644 index 0000000000..79ee96fdfd --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/environment.ts @@ -0,0 +1,7 @@ +// The file for the current environment will overwrite this one during build +// Different environments can be found in config/environment.{dev|prod}.ts +// The build system defaults to the dev environment + +export const environment = { + production: false +}; diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/index.ts b/public/docs/_examples/cli-quickstart/ts/src/app/index.ts new file mode 100644 index 0000000000..e4a0d09c55 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/app/index.ts @@ -0,0 +1,2 @@ +export * from './environment'; +export * from './cli-quickstart.component'; diff --git a/public/docs/_examples/cli-quickstart/ts/src/app/shared/index.ts b/public/docs/_examples/cli-quickstart/ts/src/app/shared/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/docs/_examples/cli-quickstart/ts/src/favicon.ico b/public/docs/_examples/cli-quickstart/ts/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8081c7ceaf2be08bf59010158c586170d9d2d517 GIT binary patch literal 5430 zcmc(je{54#6vvCoAI3i*G5%$U7!sA3wtMZ$fH6V9C`=eXGJb@R1%(I_{vnZtpD{6n z5Pl{DmxzBDbrB>}`90e12m8T*36WoeDLA&SD_hw{H^wM!cl_RWcVA!I+x87ee975; z@4kD^=bYPn&pmG@(+JZ`rqQEKxW<}RzhW}I!|ulN=fmjVi@x{p$cC`)5$a!)X&U+blKNvN5tg=uLvuLnuqRM;Yc*swiexsoh#XPNu{9F#c`G zQLe{yWA(Y6(;>y|-efAy11k<09(@Oo1B2@0`PtZSkqK&${ zgEY}`W@t{%?9u5rF?}Y7OL{338l*JY#P!%MVQY@oqnItpZ}?s z!r?*kwuR{A@jg2Chlf0^{q*>8n5Ir~YWf*wmsh7B5&EpHfd5@xVaj&gqsdui^spyL zB|kUoblGoO7G(MuKTfa9?pGH0@QP^b#!lM1yHWLh*2iq#`C1TdrnO-d#?Oh@XV2HK zKA{`eo{--^K&MW66Lgsktfvn#cCAc*(}qsfhrvOjMGLE?`dHVipu1J3Kgr%g?cNa8 z)pkmC8DGH~fG+dlrp(5^-QBeEvkOvv#q7MBVLtm2oD^$lJZx--_=K&Ttd=-krx(Bb zcEoKJda@S!%%@`P-##$>*u%T*mh+QjV@)Qa=Mk1?#zLk+M4tIt%}wagT{5J%!tXAE;r{@=bb%nNVxvI+C+$t?!VJ@0d@HIyMJTI{vEw0Ul ze(ha!e&qANbTL1ZneNl45t=#Ot??C0MHjjgY8%*mGisN|S6%g3;Hlx#fMNcL<87MW zZ>6moo1YD?P!fJ#Jb(4)_cc50X5n0KoDYfdPoL^iV`k&o{LPyaoqMqk92wVM#_O0l z09$(A-D+gVIlq4TA&{1T@BsUH`Bm=r#l$Z51J-U&F32+hfUP-iLo=jg7Xmy+WLq6_tWv&`wDlz#`&)Jp~iQf zZP)tu>}pIIJKuw+$&t}GQuqMd%Z>0?t%&BM&Wo^4P^Y z)c6h^f2R>X8*}q|bblAF?@;%?2>$y+cMQbN{X$)^R>vtNq_5AB|0N5U*d^T?X9{xQnJYeU{ zoZL#obI;~Pp95f1`%X3D$Mh*4^?O?IT~7HqlWguezmg?Ybq|7>qQ(@pPHbE9V?f|( z+0xo!#m@Np9PljsyxBY-UA*{U*la#8Wz2sO|48_-5t8%_!n?S$zlGe+NA%?vmxjS- zHE5O3ZarU=X}$7>;Okp(UWXJxI%G_J-@IH;%5#Rt$(WUX?6*Ux!IRd$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- + + + + + CliQuickstart + + + {{#unless environment.production}} + + {{/unless}} + + + + + + Loading... + + + + {{#each scripts.polyfills}}{{/each}} + + + + + + + + + + diff --git a/public/docs/_examples/cli-quickstart/ts/src/main.ts b/public/docs/_examples/cli-quickstart/ts/src/main.ts new file mode 100644 index 0000000000..c3561a2c57 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/main.ts @@ -0,0 +1,18 @@ +// #docplaster +// #docregion important +import { bootstrap } from '@angular/platform-browser-dynamic'; + +// #enddocregion important +import { enableProdMode } from '@angular/core'; +import { environment } from './app/'; +// #docregion important +import { CliQuickstartAppComponent } from './app/'; +// #enddocregion important +if (environment.production) { + enableProdMode(); +} + +// #docregion important + +bootstrap(CliQuickstartAppComponent); +// #enddocregion important diff --git a/public/docs/_examples/cli-quickstart/ts/src/system-config.ts b/public/docs/_examples/cli-quickstart/ts/src/system-config.ts new file mode 100644 index 0000000000..d2af1aac0c --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/system-config.ts @@ -0,0 +1,54 @@ +/*********************************************************************************************** + * User Configuration. + **********************************************************************************************/ +/** Map relative paths to URLs. */ +const map: any = { +}; + +/** User packages configuration. */ +const packages: any = { +}; + +//////////////////////////////////////////////////////////////////////////////////////////////// +/*********************************************************************************************** + * Everything underneath this line is managed by the CLI. + **********************************************************************************************/ +const barrels: string[] = [ + // Angular specific barrels. + '@angular/core', + '@angular/common', + '@angular/compiler', + '@angular/http', + '@angular/router', + '@angular/platform-browser', + '@angular/platform-browser-dynamic', + + // Thirdparty barrels. + 'rxjs', + + // App specific barrels. + 'app', + 'app/shared', + /** @cli-barrel */ +]; + +const cliSystemConfigPackages: any = {}; +barrels.forEach((barrelName: string) => { + cliSystemConfigPackages[barrelName] = { main: 'index' }; +}); + +/** Type declaration for ambient System. */ +declare var System: any; + +// Apply the CLI SystemJS configuration. +System.config({ + map: { + '@angular': 'vendor/@angular', + 'rxjs': 'vendor/rxjs', + 'main': 'main.js' + }, + packages: cliSystemConfigPackages +}); + +// Apply the user's configuration. +System.config({ map, packages }); diff --git a/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts b/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts new file mode 100644 index 0000000000..eebc2728b8 --- /dev/null +++ b/public/docs/_examples/cli-quickstart/ts/src/typings.d.ts @@ -0,0 +1 @@ +/// diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json index e783edfb73..f72f1f53e8 100644 --- a/public/docs/_examples/package.json +++ b/public/docs/_examples/package.json @@ -7,6 +7,7 @@ "e2e": "tsc && concurrently \"http-server\" \"protractor protractor.config.js\"", "http-server": "tsc && http-server", "http-server:e2e": "http-server", + "http-server:cli": "http-server dist/", "lite": "lite-server", "postinstall": "typings install", "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", @@ -17,7 +18,8 @@ "webdriver:update": "webdriver-manager update", "start:webpack": "webpack-dev-server --inline --progress --port 8080", "test:webpack": "karma start karma.webpack.conf.js", - "build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail" + "build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail", + "build:cli": "ng build" }, "keywords": [], "author": "", @@ -32,17 +34,16 @@ "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", "@angular/upgrade": "2.0.0-rc.1", - "systemjs": "0.19.27", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.6", "zone.js": "^0.6.12", - "angular2-in-memory-web-api": "0.0.11", "bootstrap": "^3.3.6" }, "devDependencies": { + "angular-cli": "^1.0.0-beta.5", "canonical-path": "0.0.2", "concurrently": "^2.0.0", "css-loader": "^0.23.1", diff --git a/public/docs/ts/latest/_data.json b/public/docs/ts/latest/_data.json index 4c5dd3550f..6df7846a08 100644 --- a/public/docs/ts/latest/_data.json +++ b/public/docs/ts/latest/_data.json @@ -6,6 +6,13 @@ "banner": "Welcome to Angular in TypeScript! The current Angular 2 release is rc.1. Please consult the Change Log about recent enhancements, fixes, and breaking changes." }, + "cli-quickstart": { + "icon": "query-builder", + "title": "CLI Quickstart", + "description": "Use the CLI tool to build apps quickly in Angular 2", + "hide": true + }, + "quickstart": { "icon": "query-builder", "title": "5 Min Quickstart", diff --git a/public/docs/ts/latest/cli-quickstart.jade b/public/docs/ts/latest/cli-quickstart.jade new file mode 100644 index 0000000000..0a9a2d8636 --- /dev/null +++ b/public/docs/ts/latest/cli-quickstart.jade @@ -0,0 +1,278 @@ +include _util-fns + +:marked + Good tools make application development quicker and easier to maintain than + if we did everything by hand. + + The [**Angular-CLI**](https://cli.angular.io/) is a **_command line interface_** tool + that can create a project, add files, and perform a variety of on-going development tasks such + as testing, bundling, and deployment. + + Our goal in this CLI QuickStart chapter is to build and run a super-simple Angular 2 + application in TypeScript, using Angular-CLI + while adhering to the [Style Guide](./guide/style-guide.html) recommendations that + benefit _every_ Angular 2 project. + + By the end of the chapter, we'll have a basic understanding of development with the CLI + and a foundation for both these documentation samples and our real world applications. + + We'll pursue these ends in the following high-level steps: + + 1. [Set up](#devenv) the development environment + 2. [Create](#create-proj) a new project and skeleton application + 3. [Serve](#serve) the application + 4. [Edit](#first-component) the application + + +.l-main-section +h2#devenv Step 1. Set up the Development Environment +:marked + We need to set up our development environment before we can do anything. + + Install **[Node.js® and npm](https://nodejs.org/en/download/)** + if they are not already on your machine. +.l-sub-section + :marked + **Verify that you are running node `v5.x.x` and npm `3.x.x`** + by running `node -v` and `npm -v` in a terminal/console window. + Older versions produce errors. +:marked + Then **install the [Angular-CLI](https://github.com/angular/angular-cli)** globally. + +code-example(format=""). + npm install -g angular-cli + +.l-main-section +h2#create-project Step 2. Create a new project +:marked + Open a terminal window. + +.alert.is-important + :marked + _Windows Developers_: open a console window _as an **administrator**_. + The Angular-CLI build steps later in this tutorial + create symbolic links + to various directories. These so-called _symlinks_ save time and space. + But it takes administrator rights under Windows to create them. + +:marked + Generate a new project and skeleton application by running the following commands: + +code-example(format=""). + ng new cli-quickstart + +.l-sub-section + :marked + Patience please. + It takes time to set up a new project, most of it spent installing npm packages. + +.l-main-section +h2#serve Step 3: Serve the application +:marked + Go to the project directory and launch the server. +code-example(format=""). + cd cli-quickstart + ng serve +:marked + The `ng serve` command launches the server, watches our files, + and rebuilds the app as we make changes to the files. + + Open a browser on `http://localhost:4200/`; the app greets us with a message: + +figure.image-display + img(src='/resources/images/devguide/cli-quickstart/app-works.png' alt="Our app works!") + +.l-main-section +h2#first-component Step 4: Edit our first Angular component +:marked + The CLI created our first Angular component for us. + This is the _root component_ and it is named after the project. We created the project + with the name `cli-quickstart` so our component is `CliQuickstartAppComponent` and + it's in the file `/src/app/cli-quickstart.component.ts` +.l-sub-section + :marked + _CliQuickstartAppComponent_ is a _horrible name_. Almost everyone renames it to _AppComponent_ ... + and renames all of the associated files to _app.component.??_ as we do throughout the documentation. + We'll leave that step as an exercise. + +:marked + Open the component file and change the `title` property from _cli-quickstart works!_ to _My First Angular 2 App_: + ++makeExample('cli-quickstart/ts/src/app/cli-quickstart.component.ts', 'title', 'src/app/cli-quickstart.component.ts')(format=".") + +:marked + The browser reloads automatically and we see the revised title. That's nice, but we can make it look better. + + Open `src/app/cli-quickstart.component.css` and give our component some style + ++makeExample('cli-quickstart/ts/src/app/cli-quickstart.component.css', null, 'src/app/cli-quickstart.component.css')(format=".") + +figure.image-display + img(src='/resources/images/devguide/cli-quickstart/my-first-app.png' alt="Output of QuickStart app") + +:marked + Looking good! + +.l-main-section +:marked + ## What's next? + Our first application doesn't do much. It's basically "Hello, World" for Angular 2. + + We kept it simple in our first pass: we wrote our first Angular 2 application using the angular CLI + and modified our first component. That's about all we'd expect to do for a "Hello, World" app. + + **We have greater ambitions!** +:marked + We're about to take the next step and build a small application that + demonstrates the great things we can build with Angular 2. + + Join us on the [Tour of Heroes Tutorial](./tutorial)! + + Or stick around a bit longer to learn a few things about what we just did. +

      +.l-main-section +h1#behind-the-code Behind the code +:marked + ### CliQuickstartAppComponent is the root of the application + + Every Angular app has at least one **root component**, that hosts the client user experience. + Components are the basic building blocks of Angular applications. + A component controls a portion of the screen — a *view* — through its associated template. + + This QuickStart has only one, extremely simple component. + But it has the essential structure of every component we'll ever write: + + * one or more [import](#component-import) + statements to reference the things we need. + * a [@Component decorator](#component-decorator) + that tells Angular what template to use and how to create the component. + * a [component class](#component-class) + that controls the appearance and behavior of a view through its template. + +a#component-import +:marked + ### Import + + Angular apps are modular. They consist of many files, each dedicated to a purpose. + + Angular itself is modular. It is a collection of library modules + consisting of several, related features that we'll use to build our application. + + When we need something from a module or library, we import it. + Here we import the `Component` decorator from the Angular 2 **_core_** library + that we'll use as a decorator (`@Component`) to attach metadata to our component class. + . + ++makeExcerpt('src/app/cli-quickstart.component.ts', 'import') + +h3#component-decorator @Component decorator +:marked + `Component` is a *decorator* function that associates Angular *metadata* with a + component class. + The metadata tell Angular how to create and display instances of this component. + + We apply this function to the component class by prefixing the function name with the + **@** symbol and invoking it with a metadata object, just above the class. + ++makeExcerpt('src/app/cli-quickstart.component.ts', 'metadata') + +:marked + This particular metadata object has four fields, a `moduleId`, a `selector` a `templateUrl` and an array of `styleUrls`. + + The **moduleId** specifies the location of _this_ component definition file + so that Angular can find the corresponding _template_ and _style_ files with URLs that + are relative to this component file. + The module loader sets the value of `module.id` at runtime; + we're using that value to set the metadata `moduleId` property. + + The **selector** is a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) + identifying the HTML element that represents this component. + + The element tag name for this component is `cli-quickstart-app`. + Angular creates and displays an instance of our `CliQuickstartAppComponent` + wherever it encounters a `` element in the host HTML. + + The **templateUrl** locates the component's companion template HTML file. + The template tells Angular how to render this component's view. + + Our template is a single `

      ` element surrounding some peculiar Angular data binding syntax. ++makeExample('src/app/cli-quickstart.component.html', null, 'src/app/cli-quickstart.component.html')(format='.') +:marked + The `{{title}}` is an _interpolation_ binding that causes Angular to display the component's + `title` property. After out edit, Angular displays _My First Angular 2 App_. + We'll learn more about data binding as we read through the documentation. + + The **styleUrls** array specifies the location(s) of the component's private CSS style file(s). + The CLI generated an empty file for us and we added styles to it. + +:marked + ### Component class + At the bottom of the component definition file is the component class named `CliQuickstartAppComponent`. ++makeExcerpt('cli-quickstart/ts/src/app/cli-quickstart.component.ts', 'class') +:marked + This class contains the `title` property that we're displaying in our template. + We can expand this class with more properties and application logic. + + We **export** `CliQuickstartAppComponent` so that we can **import** it elsewhere in our application ... as we're about to do. + +:marked + ### The *main.ts* file + + How does Angular know what to do with our component? We have to tell it. + We _bootstrap_ our application in the file `main.ts`. + ++makeExcerpt('src/main.ts', 'important') + +:marked + We import the two things we need to launch the application: + + 1. Angular's browser `bootstrap` function + 1. The application root component, `CliQuickstartAppComponent`. + + Then we call `bootstrap` with `CliQuickstartAppComponent`. + + ### Bootstrapping is platform-specific + Notice that we import the `bootstrap` function from `@angular/platform-browser-dynamic`, + not `@angular/core`. + Bootstrapping isn't core because there isn't a single way to bootstrap the app. + True, most applications that run in a browser call the bootstrap function from + this library. + + But it is possible to load a component in a different environment. + We might load it on a mobile device with [Apache Cordova](https://cordova.apache.org/) or [NativeScript](https://www.nativescript.org/). + We might wish to render the first page of our application on the server + to improve launch performance or facilitate + [SEO](http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf). + These targets require a different kind of bootstrap function that we'd import from a different library. + + ### Why create a *main.ts* file? + + Both `main.ts` and the application component files are tiny. + This is just a QuickStart. + We could have merged these two files into one + and spared ourselves some complexity. + + We'd rather demonstrate the proper way to structure an Angular application. + App bootstrapping is a separate concern from presenting a view. + Mixing concerns creates difficulties down the road. + We might launch the `CliQuickstartAppComponent` in multiple environments with different bootstrappers. + Testing the component is much easier if it doesn't also try to run the entire application. + Let's make the small extra effort to do it *the right way*. + + ### Loading the application with SystemJS + + The CLI uses `System.js` to load the application. We just need to call `System.import` and pass it our `main.ts` + file to boot our application. + ++makeExcerpt('src/index.html', 'import') + +:marked + ### Displaying the root component + + When Angular calls the `bootstrap` function in `main.ts`, it reads the `CliQuickstartAppComponent` + metadata, finds the `cli-quickstart-app` selector, locates an element tag named `cli-quickstart-app` + in the `` tag of the `index.html`, and renders our application's view between those tags. ++makeExcerpt('src/index.html', 'body') +:marked + This is just a taste of Angular 2 develoment. There's much more to learn. Now really is the time to + head over to the [Tour of Heroes Tutorial](./tutorial)! diff --git a/public/resources/images/devguide/cli-quickstart/app-works.png b/public/resources/images/devguide/cli-quickstart/app-works.png new file mode 100644 index 0000000000000000000000000000000000000000..e0b9fb73f56df97b38de9109e8ae8f7960f47a7c GIT binary patch literal 15107 zcmb8VQ+Q@!kTv?nwrx8dvtxE_+fFB6>~w6~w%M_bj&0jM-7|A$<~---|M$gy)_$v2 zt$OQn?Fv(nlR$vQg#`cr2vU-wN&o-|-CxWL4f*#?22q&-0FW{uB0{gcw8U42}nOi%w{lEh#dI0{tB;+Hx zBo@#?wf%2CUtdd$iv00AK+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Dv(-Eba9j)+VPj~i^o*s0$u0H*4t(1 zq-e4zI3gjwIyNOh(*+@gb*%$Dpu3rU@0$f*g zSL4I(jNi<|87z^&xJC!b6&i8&`a;do+9u9tq@Pgl{$8uG6ZWWzQq?D~+q=WTSW)u6jrtbEqry`fyc(ca`b~ z;FRV)cg3k=8mTlXz`}W@J{$GlozQdpp0du{FE6K6D;^f*8=1{0cs}Pu=Vvpjisz;GQ(~`0CB*g;wa8&}5GK}K^ zc(z9gCv=RT@lY%IRod7>?F8{Lyr?j>VHg-(J|3JnPNPQClPE#x_JLnKYHg9mCx#b4=%_YZnfKX~|YQ=JpMplV1#xIN|+HRGwV9>6TiuEd1eTywa zJ~h``0}TBQJd#-~bl1DcK-wKTB;NjkrzB8|qvu0>zOCr-j$4}I)qRP4qB6~!6joWZ zpSl|FpByY6w=nT<0e`^Tf8NI=h&Fb$D1kyZM)rL5sW^TQSGxImo!p!;P{&p$|KN;{8Qd3)2 zfZ_x)-A{N+x*iI08xK|j3T3u+ASni>@C+?7E;VDI7uC04e zk><_fl22I;+0pn3{yq1}ON$C0lZ{}NHz628B%e354pQk}Z?F4-6vaSX+n-b^l`_qZ z>0si@xwpnLG8Xo8kuL*sb&0iv8nw9l%1%}ymuE9)O0&Qv0eX0KYAFuVj*V46RibhS zNNEk28u&WTXajjU>oTAx{`nzMO|W2jvSS+s(cGcC3AX{thY#If`UFKS7>8BnhKSuoYHMn5sW7PkQd0qt2Mt2O?QETX#2=&O%R%V$+5%>tAA#9b5#B zX>fp8;DYPR;F$H2+Y+xNU6FB)2MP}X5f>_MTqEa1-|6~QIc1atC2Aa|3ANjT`B+o literal 0 HcmV?d00001 From 7db66848866d03253f492a97a4c519ef7e83de16 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 08:02:57 -0700 Subject: [PATCH 0007/1217] chore(dart): add/cleanup example hosting config files (#1605) --- public/docs/_examples/architecture/dart/.docsync.json | 4 ++-- .../docs/_examples/attribute-directives/dart/.docsync.json | 4 ++++ .../docs/_examples/dependency-injection/dart/.docsync.json | 4 ++-- public/docs/_examples/displaying-data/dart/.docsync.json | 4 ++-- public/docs/_examples/forms/dart/.docsync.json | 4 ++-- .../hierarchical-dependency-injection/dart/.docsync.json | 4 ++++ public/docs/_examples/pipes/dart/.docsync.json | 4 ++++ public/docs/_examples/quickstart/dart/.docsync.json | 3 +++ .../docs/_examples/server-communication/dart/.docsync.json | 4 ++-- public/docs/_examples/template-syntax/dart/.docsync.json | 4 ++-- public/docs/_examples/toh-1/dart/.docsync.json | 5 +++++ public/docs/_examples/toh-2/dart/.docsync.json | 5 +++++ public/docs/_examples/toh-3/dart/.docsync.json | 5 +++++ public/docs/_examples/toh-4/dart/.docsync.json | 5 +++++ public/docs/_examples/toh-5/dart/.docsync.json | 5 +++++ public/docs/_examples/user-input/dart/.docsync.json | 4 ++-- 16 files changed, 54 insertions(+), 14 deletions(-) create mode 100644 public/docs/_examples/attribute-directives/dart/.docsync.json create mode 100644 public/docs/_examples/hierarchical-dependency-injection/dart/.docsync.json create mode 100644 public/docs/_examples/pipes/dart/.docsync.json create mode 100644 public/docs/_examples/quickstart/dart/.docsync.json create mode 100644 public/docs/_examples/toh-1/dart/.docsync.json create mode 100644 public/docs/_examples/toh-2/dart/.docsync.json create mode 100644 public/docs/_examples/toh-3/dart/.docsync.json create mode 100644 public/docs/_examples/toh-4/dart/.docsync.json create mode 100644 public/docs/_examples/toh-5/dart/.docsync.json diff --git a/public/docs/_examples/architecture/dart/.docsync.json b/public/docs/_examples/architecture/dart/.docsync.json index f47a6645ce..59471b5a08 100644 --- a/public/docs/_examples/architecture/dart/.docsync.json +++ b/public/docs/_examples/architecture/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "Architecture overview", - "docHref": "https://angular.io/docs/dart/latest/guide/architecture.html" + "title": "Architecture Overview", + "docPart": "guide" } diff --git a/public/docs/_examples/attribute-directives/dart/.docsync.json b/public/docs/_examples/attribute-directives/dart/.docsync.json new file mode 100644 index 0000000000..de4f8418ee --- /dev/null +++ b/public/docs/_examples/attribute-directives/dart/.docsync.json @@ -0,0 +1,4 @@ +{ + "title": "Attribute Directives", + "docPart": "guide" +} diff --git a/public/docs/_examples/dependency-injection/dart/.docsync.json b/public/docs/_examples/dependency-injection/dart/.docsync.json index 3695627e50..fe3b9a3073 100644 --- a/public/docs/_examples/dependency-injection/dart/.docsync.json +++ b/public/docs/_examples/dependency-injection/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "Dependency injection", - "docHref": "https://angular.io/docs/dart/latest/guide/dependency-injection.html" + "title": "Dependency Injection", + "docPart": "guide" } diff --git a/public/docs/_examples/displaying-data/dart/.docsync.json b/public/docs/_examples/displaying-data/dart/.docsync.json index 3d1d13a2df..b5fefc76cc 100644 --- a/public/docs/_examples/displaying-data/dart/.docsync.json +++ b/public/docs/_examples/displaying-data/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "Displaying data", - "docHref": "https://angular.io/docs/dart/latest/guide/displaying-data.html" + "title": "Displaying Data", + "docPart": "guide" } diff --git a/public/docs/_examples/forms/dart/.docsync.json b/public/docs/_examples/forms/dart/.docsync.json index 066f6e56e9..962346743f 100644 --- a/public/docs/_examples/forms/dart/.docsync.json +++ b/public/docs/_examples/forms/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "Forms", - "docHref": "https://angular.io/docs/dart/latest/guide/forms.html" + "title": "Forms", + "docPart": "guide" } diff --git a/public/docs/_examples/hierarchical-dependency-injection/dart/.docsync.json b/public/docs/_examples/hierarchical-dependency-injection/dart/.docsync.json new file mode 100644 index 0000000000..a458150445 --- /dev/null +++ b/public/docs/_examples/hierarchical-dependency-injection/dart/.docsync.json @@ -0,0 +1,4 @@ +{ + "title": "Hierarchical Dependency Injection", + "docPart": "guide" +} diff --git a/public/docs/_examples/pipes/dart/.docsync.json b/public/docs/_examples/pipes/dart/.docsync.json new file mode 100644 index 0000000000..7b5fe18832 --- /dev/null +++ b/public/docs/_examples/pipes/dart/.docsync.json @@ -0,0 +1,4 @@ +{ + "title": "Pipes", + "docPart": "guide" +} diff --git a/public/docs/_examples/quickstart/dart/.docsync.json b/public/docs/_examples/quickstart/dart/.docsync.json new file mode 100644 index 0000000000..f8dc055278 --- /dev/null +++ b/public/docs/_examples/quickstart/dart/.docsync.json @@ -0,0 +1,3 @@ +{ + "title": "QuickStart" +} diff --git a/public/docs/_examples/server-communication/dart/.docsync.json b/public/docs/_examples/server-communication/dart/.docsync.json index baa578054f..4dc63783c9 100644 --- a/public/docs/_examples/server-communication/dart/.docsync.json +++ b/public/docs/_examples/server-communication/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "HTTP client (server communication)", - "docHref": "https://angular.io/docs/dart/latest/guide/server-communication.html" + "title": "HTTP Client (Server Communication)", + "docPart": "guide" } diff --git a/public/docs/_examples/template-syntax/dart/.docsync.json b/public/docs/_examples/template-syntax/dart/.docsync.json index 0caee30723..8156f76401 100644 --- a/public/docs/_examples/template-syntax/dart/.docsync.json +++ b/public/docs/_examples/template-syntax/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "Template Syntax", - "docHref": "https://angular.io/docs/ts/latest/guide/template-syntax.html" + "title": "Template Syntax", + "docPart": "guide" } diff --git a/public/docs/_examples/toh-1/dart/.docsync.json b/public/docs/_examples/toh-1/dart/.docsync.json new file mode 100644 index 0000000000..7ea3bce8f9 --- /dev/null +++ b/public/docs/_examples/toh-1/dart/.docsync.json @@ -0,0 +1,5 @@ +{ + "title": "Tour of Heroes: The Hero Editor", + "docPart": "tutorial", + "docHref": "toh-pt1.html" +} diff --git a/public/docs/_examples/toh-2/dart/.docsync.json b/public/docs/_examples/toh-2/dart/.docsync.json new file mode 100644 index 0000000000..7b3eecf567 --- /dev/null +++ b/public/docs/_examples/toh-2/dart/.docsync.json @@ -0,0 +1,5 @@ +{ + "title": "Tour of Heroes: Master/Detail", + "docPart": "tutorial", + "docHref": "toh-pt2.html" +} diff --git a/public/docs/_examples/toh-3/dart/.docsync.json b/public/docs/_examples/toh-3/dart/.docsync.json new file mode 100644 index 0000000000..b6418ebe94 --- /dev/null +++ b/public/docs/_examples/toh-3/dart/.docsync.json @@ -0,0 +1,5 @@ +{ + "title": "Tour of Heroes: Multiple Components", + "docPart": "tutorial", + "docHref": "toh-pt3.html" +} diff --git a/public/docs/_examples/toh-4/dart/.docsync.json b/public/docs/_examples/toh-4/dart/.docsync.json new file mode 100644 index 0000000000..fa76636c8e --- /dev/null +++ b/public/docs/_examples/toh-4/dart/.docsync.json @@ -0,0 +1,5 @@ +{ + "title": "Tour of Heroes: Services", + "docPart": "tutorial", + "docHref": "toh-pt4.html" +} diff --git a/public/docs/_examples/toh-5/dart/.docsync.json b/public/docs/_examples/toh-5/dart/.docsync.json new file mode 100644 index 0000000000..74d2e1165a --- /dev/null +++ b/public/docs/_examples/toh-5/dart/.docsync.json @@ -0,0 +1,5 @@ +{ + "title": "Tour of Heroes: Routing", + "docPart": "tutorial", + "docHref": "toh-pt5.html" +} diff --git a/public/docs/_examples/user-input/dart/.docsync.json b/public/docs/_examples/user-input/dart/.docsync.json index 7538cfa2a0..14a4c32d55 100644 --- a/public/docs/_examples/user-input/dart/.docsync.json +++ b/public/docs/_examples/user-input/dart/.docsync.json @@ -1,4 +1,4 @@ { - "name": "User input", - "docHref": "https://angular.io/docs/dart/latest/guide/user-input.html" + "title": "User Input", + "docPart": "guide" } From e6643b0869de7fc5049088244d270c984971df57 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 08:54:43 -0700 Subject: [PATCH 0008/1217] chore(gulpfile): don't watch generated dart packages (#1601) --- gulpfile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index dd0eebb235..2adac97a80 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -958,8 +958,9 @@ function devGuideExamplesWatch(shredOptions, postShredAction) { // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { - var files = globby.sync( [includePattern], { ignore: [ '**/node_modules/**', '**/_fragments/**', - '**/dart/build/**' ]}); + var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', + '**/dart/.pub/**', '**/dart/build/**', '**/dart/packages/**']; + var files = globby.sync( [includePattern], { ignore: ignoreThese }); gulp.watch([files], {readDelay: 500}, function (event, done) { gutil.log('Dev Guide example changed') gutil.log('Event type: ' + event.type); // added, changed, or deleted From 3c77a7fcd1d9aaebc0f248b6e95d57e32a87df13 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 09:25:48 -0700 Subject: [PATCH 0009/1217] docs(basics/di): minor edits following TS switch to provider object literal (#1600) Minor edits: - Dart side adjustments following #1594. - Renamed example '3a' to just '3' and tweaked the logger message - Removed obsolete Dart block. --- .../dart/lib/providers_component.dart | 17 ++++++++++------- .../_examples/dependency-injection/e2e-spec.ts | 6 +++--- .../ts/app/providers.component.ts | 14 +++++++------- .../dart/latest/guide/dependency-injection.jade | 9 ++++++--- .../ts/latest/guide/dependency-injection.jade | 10 ++++++---- 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/public/docs/_examples/dependency-injection/dart/lib/providers_component.dart b/public/docs/_examples/dependency-injection/dart/lib/providers_component.dart index 11f2184242..a52ea6d267 100644 --- a/public/docs/_examples/dependency-injection/dart/lib/providers_component.dart +++ b/public/docs/_examples/dependency-injection/dart/lib/providers_component.dart @@ -29,15 +29,18 @@ class ProviderComponent1 { /// Component just used to ensure that shared E2E tests pass. @Component( - selector: 'provider-3a', + selector: 'provider-3', template: '{{log}}', - providers: const [const Provider(Logger, useClass: Logger)] + providers: + // #docregion providers-3 + const [const Provider(Logger, useClass: Logger)] + // #enddocregion providers-3 ) -class ProviderComponent3a { +class ProviderComponent3 { String log; - ProviderComponent3a(Logger logger) { - logger.log('Hello from logger provided with {provide: Logger, useClass: Logger}'); + ProviderComponent3(Logger logger) { + logger.log('Hello from logger provided with useClass:Logger'); log = logger.logs[0]; } } @@ -250,7 +253,7 @@ class ProviderComponent10 implements OnInit { template: '''

      Provider variations

      -
      +
      @@ -261,7 +264,7 @@ class ProviderComponent10 implements OnInit {
      ''', directives: const [ ProviderComponent1, - ProviderComponent3a, + ProviderComponent3, ProviderComponent4, ProviderComponent5, ProviderComponent6a, diff --git a/public/docs/_examples/dependency-injection/e2e-spec.ts b/public/docs/_examples/dependency-injection/e2e-spec.ts index d4625478f3..51b73ad40f 100644 --- a/public/docs/_examples/dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/dependency-injection/e2e-spec.ts @@ -80,9 +80,9 @@ describe('Dependency Injection Tests', function () { expect(element(by.css('#p1')).getText()).toEqual(expectedMsg); }); - it('P3a (provide) displays as expected', function () { - expectedMsg = 'Hello from logger provided with { provide: Logger, useClass: Logger }'; - expect(element(by.css('#p3a')).getText()).toEqual(expectedMsg); + it('P3 (provide) displays as expected', function () { + expectedMsg = 'Hello from logger provided with useClass:Logger'; + expect(element(by.css('#p3')).getText()).toEqual(expectedMsg); }); it('P4 (useClass:BetterLogger) displays as expected', function () { diff --git a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts index 61c53bb862..74c36d8e62 100644 --- a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts @@ -31,17 +31,17 @@ export class ProviderComponent1 { ////////////////////////////////////////// @Component({ - selector: 'provider-3a', + selector: 'provider-3', template: template, providers: - // #docregion providers-3a + // #docregion providers-3 [{ provide: Logger, useClass: Logger }] - // #enddocregion providers-3a + // #enddocregion providers-3 }) -export class ProviderComponent3a { +export class ProviderComponent3 { log: string; constructor(logger: Logger) { - logger.log('Hello from logger provided with { provide: Logger, useClass: Logger }'); + logger.log('Hello from logger provided with useClass:Logger'); this.log = logger.logs[0]; } } @@ -252,7 +252,7 @@ export class ProviderComponent10 { template: `

      Provider variations

      -
      +
      @@ -264,7 +264,7 @@ export class ProviderComponent10 { `, directives: [ ProviderComponent1, - ProviderComponent3a, + ProviderComponent3, ProviderComponent4, ProviderComponent5, ProviderComponent6a, diff --git a/public/docs/dart/latest/guide/dependency-injection.jade b/public/docs/dart/latest/guide/dependency-injection.jade index 0f991c5673..aaef0260d9 100644 --- a/public/docs/dart/latest/guide/dependency-injection.jade +++ b/public/docs/dart/latest/guide/dependency-injection.jade @@ -43,8 +43,10 @@ block real-logger A real implementation would probably use the [logging package](https://pub.dartlang.org/packages/logging). -block optional-logger - //- TBC. +block canonical-provider-expr + |  that creates a new instance of the  + a(href="../api/core/Provider-class.html") Provider + |  class: block provider-ctor-args - var _secondParam = 'named parameter, such as useClass' @@ -61,7 +63,8 @@ block dart-diff-const-metadata Instead, we use constant literals or constant constructors. For example, a TypeScript program will use the object literal `{ provide: Logger, useClass: BetterLogger }`. - A Dart annotation would instead use the constant value `const Provider(Logger, useClass: BetterLogger)`. + A Dart annotation would instead use the constant value + `const Provider(Logger, useClass: BetterLogger)`. block dart-diff-const-metadata-ctor .callout.is-helpful diff --git a/public/docs/ts/latest/guide/dependency-injection.jade b/public/docs/ts/latest/guide/dependency-injection.jade index 9e5ccf2f7d..94e0ec0111 100644 --- a/public/docs/ts/latest/guide/dependency-injection.jade +++ b/public/docs/ts/latest/guide/dependency-injection.jade @@ -518,14 +518,16 @@ code-example(format="nocode"). +makeExample('dependency-injection/ts/app/providers.component.ts','providers-1') -:marked - This is actually a short-hand expression for a provider registration using the _provider_ object literal. +p + | This is actually a short-hand expression for a provider registration + block canonical-provider-expr + |  using a provider object literal with two properties: -+makeExample('dependency-injection/ts/app/providers.component.ts','providers-3a') ++makeExample('dependency-injection/ts/app/providers.component.ts','providers-3') block provider-ctor-args - var _secondParam = 'provider definition object'; -//- var _secondParam = _docsFor == 'dart' ? 'named parameter, such as useClass' : 'provider definition object'; + :marked The first is the [token](#token) that serves as the key for both locating a dependency value and registering the provider. From 1cc5284cc2049d58563bc598c4807f7e593ab99c Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Wed, 8 Jun 2016 16:24:56 -0700 Subject: [PATCH 0010/1217] docs(toh-2/dart): copyedits (#1621) --- .../toh-2/dart/lib/app_component.dart | 19 ++++---- .../docs/_examples/toh-2/dart/web/main.dart | 4 +- public/docs/dart/latest/tutorial/toh-pt2.jade | 45 +++++++++---------- 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/public/docs/_examples/toh-2/dart/lib/app_component.dart b/public/docs/_examples/toh-2/dart/lib/app_component.dart index 4959afe753..66268118dc 100644 --- a/public/docs/_examples/toh-2/dart/lib/app_component.dart +++ b/public/docs/_examples/toh-2/dart/lib/app_component.dart @@ -1,4 +1,4 @@ -// #docregion pt2 +// #docregion import 'package:angular2/core.dart'; class Hero { @@ -29,7 +29,7 @@ class Hero { ''', -// #docregion styles-1 +// #docregion styles styles: const [ ''' .selected { @@ -80,21 +80,21 @@ class Hero { } ''' ]) -// #enddocregion styles-1 +// #enddocregion styles class AppComponent { final String title = 'Tour of Heroes'; final List heroes = mockHeroes; -// #docregion selected-hero-1 +// #docregion selected-hero Hero selectedHero; -// #enddocregion selected-hero-1 +// #enddocregion selected-hero -// #docregion on-select-1 +// #docregion on-select onSelect(Hero hero) { selectedHero = hero; } -// #enddocregion on-select-1 +// #enddocregion on-select } -// #enddocregion pt2 +// #enddocregion // #docregion hero-array final List mockHeroes = [ @@ -109,6 +109,3 @@ final List mockHeroes = [ new Hero(19, 'Magma'), new Hero(20, 'Tornado') ]; -// #enddocregion hero-array - -// #enddocregion pt2 diff --git a/public/docs/_examples/toh-2/dart/web/main.dart b/public/docs/_examples/toh-2/dart/web/main.dart index 129bd9620b..ed2bb7156f 100644 --- a/public/docs/_examples/toh-2/dart/web/main.dart +++ b/public/docs/_examples/toh-2/dart/web/main.dart @@ -1,9 +1,7 @@ -// #docregion pt2 import 'package:angular2/platform/browser.dart'; import 'package:angular2_tour_of_heroes/app_component.dart'; -main() { +void main() { bootstrap(AppComponent); } -// #enddocregion pt2 diff --git a/public/docs/dart/latest/tutorial/toh-pt2.jade b/public/docs/dart/latest/tutorial/toh-pt2.jade index 1c563e9100..6127079ab1 100644 --- a/public/docs/dart/latest/tutorial/toh-pt2.jade +++ b/public/docs/dart/latest/tutorial/toh-pt2.jade @@ -6,14 +6,12 @@ include ../_util-fns We’ll expand our Tour of Heroes app to display a list of heroes, allow the user to select a hero, and display the hero’s details. +p Run the #[+liveExampleLink2('', 'toh-2')] for this part. +:marked Let’s take stock of what we’ll need to display a list of heroes. First, we need a list of heroes. We want to display those heroes in the view’s template, so we’ll need a way to do that. -.callout.is-helpful - header Source code - p Run the #[+liveExampleLink2('', 'toh-2')] for this part. - .l-main-section :marked ## Where We Left Off @@ -48,7 +46,7 @@ code-example(language="bash"). ### Creating heroes Let’s create a list of ten heroes at the bottom of `app_component.dart`. -+makeExample('toh-2/dart/lib/app_component.dart', 'hero-array', 'app_component.dart (Hero list)')(format=".") ++makeExample('toh-2/dart/lib/app_component.dart', 'hero-array', 'app_component.dart (hero list)')(format=".") :marked The `mockHeroes` list is of type `Hero`, the class defined in part one, @@ -59,7 +57,7 @@ code-example(language="bash"). ### Exposing heroes Let’s create a public property in `AppComponent` that exposes the heroes for binding. -+makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'hero-array-1', 'app_component.dart (Hero list property)') ++makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'hero-array-1', 'app_component.dart (hero list property)') .l-sub-section :marked @@ -72,7 +70,7 @@ code-example(language="bash"). Our component has `heroes`. Let’s create an unordered list in our template to display them. We’ll insert the following chunk of HTML below the title and above the hero details. -+makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'heroes-template-1', 'app_component.dart (Heroes template)')(format=".") ++makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'heroes-template-1', 'app_component.dart (heroes template)')(format=".") :marked Now we have a template that we can fill with our heroes. @@ -103,7 +101,7 @@ code-example(language="bash"). “*take each hero in the `heroes` list, store it in the local `hero` variable, and make it available to the corresponding template instance*”. - The `let` keyword before "hero" identifies the `hero` as a template input variable. + The `let` keyword before "hero" identifies `hero` as a template input variable. We can reference this variable within the template to access a hero’s properties. Learn more about `ngFor` and template input variables in the @@ -126,21 +124,20 @@ code-example(language="bash"). Let’s add some styles to our component by setting the `styles` argument of the `@Component` annotation to the following CSS classes: -+makeExample('toh-2/dart/lib/app_component.dart', 'styles-1', 'app_component.dart (Styling)')(format=".") ++makeExample('toh-2/dart/lib/app_component.dart', 'styles', 'app_component.dart (styles)')(format=".") :marked Notice that we again use the triple-quote notation for multi-line strings. + That's a lot of styles! We can put them inline as shown here, or we can move them out to their own file which will make it easier to code our component. + We'll do this in a later chapter. For now let's keep rolling. + When we assign styles to a component they are scoped to that specific component. Our styles will only apply to our `AppComponent` and won't "leak" to the outer HTML. Our template for displaying the heroes should now look like this: -+makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'heroes-styled', 'app_component.dart (Styled heroes)') - -:marked - That's a lot of styles! We can put them inline as shown here, or we can move them out to their own file which will make it easier to code our component. - We'll do this in a later chapter. For now let's keep rolling. ++makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'heroes-styled', 'app_component.dart (styled heroes)') .l-main-section :marked @@ -156,7 +153,7 @@ code-example(language="bash"). ### Click event We modify the `
    • ` by inserting an Angular event binding to its click event. - +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'selectedHero-click', 'app_component.dart (Capturing the click event)')(format=".") + +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'selectedHero-click', 'app_component.dart (template excerpt)')(format=".") :marked Focus on the event binding @@ -185,21 +182,21 @@ code-example(language="bash"). We no longer need the static `hero` property of the `AppComponent`. **Replace** it with this simple `selectedHero` property: - +makeExample('toh-2/dart/lib/app_component.dart', 'selected-hero-1', 'app_component.dart (selectedHero)') + +makeExample('toh-2/dart/lib/app_component.dart', 'selected-hero', 'app_component.dart (selectedHero)') :marked We’ve decided that none of the heroes should be selected before the user picks a hero so we won’t initialize the `selectedHero` as we were doing with `hero`. Now **add an `onSelect` method** that sets the `selectedHero` property to the `hero` the user clicked. - +makeExample('toh-2/dart/lib/app_component.dart', 'on-select-1', 'app_component.dart (onSelect)')(format=".") + +makeExample('toh-2/dart/lib/app_component.dart', 'on-select', 'app_component.dart (onSelect)')(format=".") :marked We will be showing the selected hero's details in our template. At the moment, it is still referring to the old `hero` property. Let’s fix the template to bind to the new `selectedHero` property. - +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'selectedHero-details', 'app_component.dart (Binding to the selectedHero\'s name)')(format=".") + +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'selectedHero-details', 'app_component.dart (template excerpt)')(format=".") :marked ### Hide the empty detail with ngIf @@ -261,16 +258,16 @@ code-example(language="bash"). The key is the name of the CSS class (`selected`). The value is `true` if the two heroes match and `false` otherwise. We’re saying “*apply the `selected` class if the heroes match, remove it if they don’t*”. - +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'class-selected-1', 'app_component.dart (Setting the CSS class)')(format=".") + +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'class-selected-1', 'app_component.dart (setting the CSS class)')(format=".") :marked Notice in the template that the `class.selected` is surrounded in square brackets (`[]`). - This is the syntax for a Property Binding, a binding in which data flows one way + This is the syntax for a **property binding**, a binding in which data flows one way from the data source (the expression `hero == selectedHero`) to a property of `class`. - +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'class-selected-2', 'app_component.dart (Styling each hero)')(format=".") + +makeExample('toh-2/dart-snippets/app_component_snippets_pt2.dart', 'class-selected-2', 'app_component.dart (styling each hero)')(format=".") .l-sub-section :marked - Learn more about [Property Binding](../guide/template-syntax.html#property-binding) + Learn more about [property bindings](../guide/template-syntax.html#property-binding) in the Template Syntax chapter. :marked @@ -285,7 +282,7 @@ code-example(language="bash"). Here's the complete `app_component.dart` as it stands now: - +makeExample('toh-2/dart/lib/app_component.dart', 'pt2', 'app_component.dart') + +makeExample('toh-2/dart/lib/app_component.dart', '', 'app_component.dart') .l-main-section :marked @@ -296,6 +293,8 @@ code-example(language="bash"). * We added the ability to select a hero and show the hero’s details * We learned how to use the built-in directives `ngIf` and `ngFor` in a component’s template +p Run the #[+liveExampleLink2('', 'toh-2')] for this part. +:marked ### The Road Ahead Our Tour of Heroes has grown, but it’s far from complete. We can't put the entire app into a single component. From 074a33a6225471852774b51c235f85462d12058f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 13 Jun 2016 00:41:33 +0200 Subject: [PATCH 0011/1217] chore: tslint sweep done --- .../ts/app/hero-list.component.ts | 6 +-- .../architecture/ts/app/hero.service.ts | 4 +- .../architecture/ts/app/sales-tax.service.ts | 2 +- .../ts/app/highlight.directive.1.ts | 1 + .../ts/app/highlight.directive.2.ts | 28 +++++++---- .../ts/app/highlight.directive.ts | 16 +++--- .../ts/app/date.pipe.ts | 4 +- .../ts/app/movie-list.component.ts | 1 + .../ts/app/app.component.ts | 2 +- .../cb-component-communication/ts/index.html | 2 +- .../ts/app/hero-bio.component.ts | 2 - .../ts/app/hero-bios.component.ts | 2 +- .../ts/app/hero-contact.component.ts | 2 +- .../ts/app/highlight.directive.ts | 17 ++++--- .../ts/app/parent-finder.component.ts | 6 +-- .../cb-dynamic-form/ts/app/app.component.ts | 4 +- .../ts/app/dynamic-form.component.ts | 2 +- .../ts/app/question-control.service.ts | 2 +- .../ts/app/question.service.ts | 1 - public/docs/_examples/cb-ts-to-js/e2e-spec.ts | 2 +- .../js/app/heroes-queries.component.js | 6 +-- .../ts/app/heroes-queries.component.ts | 6 +-- .../docs/_examples/cb-ts-to-js/ts/app/main.ts | 1 + .../docs/_examples/cli-quickstart/e2e-spec.ts | 4 +- .../ts/app/app.component.ts | 2 +- .../ts/app/car/car.component.ts | 6 +-- .../ts/app/heroes/hero.service.1.ts | 1 - .../ts/app/heroes/hero.service.2.ts | 1 - .../ts/app/heroes/hero.service.ts | 3 -- .../ts/app/providers.component.ts | 50 +++++++++---------- .../ts/app/hello_world.ts | 2 +- .../homepage-hello-world/ts/app/main.ts | 4 +- .../_examples/homepage-tabs/ts/app/di_demo.ts | 12 ++--- .../_examples/homepage-tabs/ts/app/main.ts | 4 +- .../_examples/homepage-tabs/ts/app/ui_tabs.ts | 12 ++--- .../_examples/homepage-todo/ts/app/main.ts | 4 +- .../homepage-todo/ts/app/todo_app.ts | 8 +-- .../homepage-todo/ts/app/todo_form.ts | 2 +- .../homepage-todo/ts/app/todo_list.ts | 2 +- .../ts/app/counter.component.ts | 8 +-- .../lifecycle-hooks/ts/app/spy.component.ts | 4 +- .../lifecycle-hooks/ts/app/spy.directive.ts | 2 +- .../_examples/pipes/ts/app/app.component.ts | 14 +++--- .../pipes/ts/app/flying-heroes.pipe.ts | 1 + .../pipes/ts/app/hero-birthday1.component.ts | 2 +- .../pipes/ts/app/hero-birthday2.component.ts | 2 +- .../app/power-boost-calculator.component.ts | 2 +- .../pipes/ts/app/power-booster.component.ts | 2 +- .../app/crisis-center/add-crisis.component.ts | 42 ---------------- .../ts/app/crisis-center/crisis.service.ts | 18 +++---- .../ts/app/heroes/hero.service.ts | 20 ++++---- .../ts/app/wiki/wiki-smart.component.ts | 1 - .../template-syntax/ts/app/app.component.ts | 2 +- .../ts/app/decorator.directive.ts | 11 ---- .../ts/app/hero-detail.component.ts | 3 +- .../ts/app/my-click.directive.ts | 1 + .../_examples/toh-2/ts/app/app.component.ts | 31 ++++++------ .../_examples/toh-3/ts/app/app.component.ts | 26 +++++----- .../_examples/toh-5/ts/app/app.component.1.ts | 1 + .../ts/app/2-to-1-transclusion/app.module.ts | 1 - .../user-input/ts/app/app.component.ts | 4 +- .../user-input/ts/app/click-me2.component.ts | 2 +- .../docs/ts/latest/cookbook/dynamic-form.jade | 6 +-- .../ts/latest/guide/attribute-directives.jade | 10 ++-- tslint.json | 8 --- 65 files changed, 199 insertions(+), 261 deletions(-) delete mode 100644 public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts delete mode 100644 public/docs/_examples/template-syntax/ts/app/decorator.directive.ts diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.ts b/public/docs/_examples/architecture/ts/app/hero-list.component.ts index 8e4ca9b1ae..d7bc9e75d9 100644 --- a/public/docs/_examples/architecture/ts/app/hero-list.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-list.component.ts @@ -24,13 +24,13 @@ export class HeroesComponent { ... } */ // #docregion class export class HeroListComponent implements OnInit { + heroes: Hero[]; + selectedHero: Hero; + // #docregion ctor constructor(private service: HeroService) { } // #enddocregion ctor - heroes: Hero[]; - selectedHero: Hero; - ngOnInit() { this.heroes = this.service.getHeroes(); } diff --git a/public/docs/_examples/architecture/ts/app/hero.service.ts b/public/docs/_examples/architecture/ts/app/hero.service.ts index d5df3bdf31..027d4bfc6a 100644 --- a/public/docs/_examples/architecture/ts/app/hero.service.ts +++ b/public/docs/_examples/architecture/ts/app/hero.service.ts @@ -7,14 +7,14 @@ import { Logger } from './logger.service'; @Injectable() // #docregion class export class HeroService { + private heroes: Hero[] = []; + // #docregion ctor constructor( private backend: BackendService, private logger: Logger) { } // #enddocregion ctor - private heroes: Hero[] = []; - getHeroes() { this.backend.getAll(Hero).then( (heroes: Hero[]) => { this.logger.log(`Fetched ${heroes.length} heroes.`); diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts index f0d5457342..5bf505548a 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts @@ -1,5 +1,5 @@ // #docregion -import { Inject, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { TaxRateService } from './tax-rate.service'; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts index f8c1a95ea1..4cacc0d22e 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ // #docregion import { Directive, ElementRef, Input } from '@angular/core'; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts index d6b295fae2..3baf3449fb 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts @@ -1,14 +1,10 @@ +/* tslint:disable:no-unused-variable */ +// #docplaster // #docregion -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - // #docregion host - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } - // #enddocregion host + selector: '[myHighlight]' }) export class HighlightDirective { @@ -18,9 +14,19 @@ export class HighlightDirective { constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion ctor - // #docregion mouse-methods - onMouseEnter() { this.highlight('yellow'); } - onMouseLeave() { this.highlight(null); } + // #docregion mouse-methods, host + @HostListener('mouseenter') onMouseEnter() { + // #enddocregion host + this.highlight('yellow'); + // #docregion host + } + + @HostListener('mouseleave') onMouseLeave() { + // #enddocregion host + this.highlight(null); + // #docregion host + } + // #enddocregion host private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts index 09a762a892..cd6c7870a1 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts @@ -1,13 +1,9 @@ // #docplaster // #docregion full -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } + selector: '[myHighlight]' }) // #docregion class-1 export class HighlightDirective { @@ -29,9 +25,13 @@ export class HighlightDirective { // #enddocregion color // #docregion mouse-enter - onMouseEnter() { this.highlight(this.highlightColor || this._defaultColor); } + @HostListener('mouseenter') onMouseEnter() { + this.highlight(this.highlightColor || this._defaultColor); + } // #enddocregion mouse-enter - onMouseLeave() { this.highlight(null); } + @HostListener('mouseleave') onMouseLeave() { + this.highlight(null); + } private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts index c04e64247d..e1421fa530 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts @@ -1,10 +1,10 @@ -import { Injectable, Pipe } from '@angular/core'; +import { Injectable, Pipe, PipeTransform } from '@angular/core'; import { DatePipe } from '@angular/common'; @Injectable() // #docregion date-pipe @Pipe({name: 'date', pure: true}) -export class StringSafeDatePipe extends DatePipe { +export class StringSafeDatePipe extends DatePipe implements PipeTransform { transform(value: any, format: string): string { value = typeof value === 'string' ? Date.parse(value) : value; diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts index 286615b95c..4157d8aa3a 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ // #docplaster // #docregion import import { Component } from '@angular/core'; diff --git a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts index 332d8f7f0f..891b5c86ac 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts @@ -25,7 +25,7 @@ if (!/e2e/.test(location.search)) { } @Component({ - selector: 'app', + selector: 'my-app', templateUrl: 'app/app.component.html', directives: directives }) diff --git a/public/docs/_examples/cb-component-communication/ts/index.html b/public/docs/_examples/cb-component-communication/ts/index.html index 51adcdaf23..4afa076c19 100644 --- a/public/docs/_examples/cb-component-communication/ts/index.html +++ b/public/docs/_examples/cb-component-communication/ts/index.html @@ -23,7 +23,7 @@ - loading... + loading... diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts index d1e44ae1b2..84f8e05e66 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts @@ -1,7 +1,6 @@ // #docregion import { Component, Input, OnInit } from '@angular/core'; -import { Hero } from './hero'; import { HeroCacheService } from './hero-cache.service'; // #docregion component @@ -17,7 +16,6 @@ import { HeroCacheService } from './hero-cache.service'; }) export class HeroBioComponent implements OnInit { - @Input() heroId: number; constructor(private heroCache: HeroCacheService) { } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts index 5ce00bba1a..8b738bf04f 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component} from '@angular/core'; +import { Component } from '@angular/core'; import { HeroContactComponent } from './hero-contact.component'; import { HeroBioComponent } from './hero-bio.component'; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts index a2cd8ec75f..add6df91c5 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; +import { Component, Host, Optional } from '@angular/core'; import { HeroCacheService } from './hero-cache.service'; import { LoggerService } from './logger.service'; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts b/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts index 69bd1a1577..e220114daa 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts @@ -1,13 +1,9 @@ // #docplaster // #docregion -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } + selector: '[myHighlight]' }) export class HighlightDirective { @@ -19,8 +15,13 @@ export class HighlightDirective { this.el = el.nativeElement; } - onMouseEnter() { this.highlight(this.highlightColor || 'cyan'); } - onMouseLeave() { this.highlight(null); } + @HostListener('mouseenter') onMouseEnter() { + this.highlight(this.highlightColor || 'cyan'); + } + + @HostListener('mouseleave') onMouseLeave() { + this.highlight(null); + } private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts index 8d0d8cc466..a8e245376c 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts @@ -1,5 +1,5 @@ -/* tslint:disable:no-unused-variable */ -/* tslint:disable:one-line:check-open-brace*/ +/* tslint:disable:no-unused-variable component-selector-name one-line check-open-brace */ +/* tslint:disable:*/ // #docplaster // #docregion import { Component, forwardRef, Optional, provide, SkipSelf } from '@angular/core'; @@ -23,7 +23,7 @@ const provideParent = // #enddocregion provide-parent, provide-the-parent // #docregion provide-parent (component: any, parentType?: any) => { - return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; + return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; }; // #enddocregion provide-parent diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts index 74a4909de3..e51561770e 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { DynamicForm } from './dynamic-form.component'; +import { DynamicFormComponent } from './dynamic-form.component'; import { QuestionService } from './question.service'; @Component({ @@ -12,7 +12,7 @@ import { QuestionService } from './question.service'; `, - directives: [DynamicForm], + directives: [DynamicFormComponent], providers: [QuestionService] }) export class AppComponent { diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts index a6374871ab..5d6eb833ed 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts @@ -12,7 +12,7 @@ import { DynamicFormQuestionComponent } from './dynamic-form-question.component' directives: [DynamicFormQuestionComponent], providers: [QuestionControlService] }) -export class DynamicForm { +export class DynamicFormComponent implements OnInit { @Input() questions: QuestionBase[] = []; form: ControlGroup; diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts index fb86366c51..3d56b0c2f6 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts @@ -1,6 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { ControlGroup, FormBuilder, Validators } from '@angular/common'; +import { FormBuilder, Validators } from '@angular/common'; import { QuestionBase } from './question-base'; @Injectable() diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts index 7ba417ee3c..ee169d0827 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { QuestionBase } from './question-base'; -import { DynamicForm } from './dynamic-form.component'; import { TextboxQuestion } from './question-textbox'; import { DropdownQuestion } from './question-dropdown'; diff --git a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts index dbb308fbf7..f5071cb9b1 100644 --- a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts +++ b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts @@ -59,7 +59,7 @@ describe('TypeScript to Javascript tests', function () { it('should support content and view queries', function() { let app = element(by.css('heroes-queries')); - let windstorm = app.element(by.css('hero:first-child')); + let windstorm = app.element(by.css('a-hero:first-child')); app.element(by.buttonText('Activate')).click(); expect(windstorm.element(by.css('h2')).getAttribute('class')).toBe('active'); diff --git a/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js b/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js index cd49a01754..17cb57093f 100644 --- a/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js +++ b/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js @@ -15,7 +15,7 @@ // #docregion content var HeroComponent = ng.core.Component({ - selector: 'hero', + selector: 'a-hero', template: '

      ' + '{{hero.name}} ' + '' + @@ -38,10 +38,10 @@ var AppComponent = ng.core.Component({ selector: 'heroes-queries', template: - '' + '' + - '' + + '' + '', diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts index be8176e951..b511f29f90 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts @@ -23,7 +23,7 @@ class ActiveLabelComponent { // #docregion content @Component({ - selector: 'hero', + selector: 'a-hero', template: `

      {{hero.name}} @@ -48,10 +48,10 @@ class HeroComponent { @Component({ selector: 'heroes-queries', template: ` - - + diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts index 340b0b9a0d..9e1540abc2 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts @@ -1,3 +1,4 @@ +/* tslint:disable no-unused-variable */ // #docregion ng2import import { bootstrap } from '@angular/platform-browser-dynamic'; diff --git a/public/docs/_examples/cli-quickstart/e2e-spec.ts b/public/docs/_examples/cli-quickstart/e2e-spec.ts index 4134ed74a1..7d5b5bf98b 100644 --- a/public/docs/_examples/cli-quickstart/e2e-spec.ts +++ b/public/docs/_examples/cli-quickstart/e2e-spec.ts @@ -2,10 +2,10 @@ describe('cli-quickstart App', () => { beforeEach(() => { return browser.get('/'); - }) + }); it('should display message saying app works', () => { - var pageTitle = element(by.css('cli-quickstart-app h1')).getText() + let pageTitle = element(by.css('cli-quickstart-app h1')).getText(); expect(pageTitle).toEqual('My First Angular 2 App'); }); }); diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.ts index 21e0d59448..bb330c9441 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.ts @@ -10,7 +10,7 @@ import { APP_CONFIG, AppConfig, HERO_DI_CONFIG } from './app.config'; import { Logger } from './logger.service'; -import { User, UserService } from './user.service'; +import { UserService } from './user.service'; // #enddocregion imports import { InjectorComponent } from './injector.component'; import { TestComponent } from './test.component'; diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts b/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts index f9f982ebd0..9a835ef124 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component, Injector } from '@angular/core'; +import { Component } from '@angular/core'; import { Car, Engine, Tires } from './car'; import { Car as CarNoDi } from './car-no-di'; @@ -27,12 +27,12 @@ import { useInjector } from './car-injector'; providers: [Car, Engine, Tires] }) export class CarComponent { - constructor(public car: Car) {} - factoryCar = (new CarFactory).createCar(); injectorCar = useInjector(); noDiCar = new CarNoDi; simpleCar = simpleCar(); superCar = superCar(); testCar = testCar(); + + constructor(public car: Car) {} } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts index a5a715dbae..dbae4c056c 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts @@ -1,7 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; @Injectable() diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts index a9d5462818..6b3a98306a 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts @@ -1,7 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; import { Logger } from '../logger.service'; diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts index 6d058f52d9..fb03ec1de6 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts @@ -1,14 +1,11 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; import { Logger } from '../logger.service'; @Injectable() export class HeroService { - private _user: string; - // #docregion internals constructor( private logger: Logger, diff --git a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts index 74c36d8e62..04089be01d 100644 --- a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts @@ -1,7 +1,7 @@ /* tslint:disable:one-line:check-open-brace*/ // Examples of provider arrays // #docplaster -import { Component, Inject, Injectable } from '@angular/core'; +import { Component, Inject, Injectable, OnInit } from '@angular/core'; import { APP_CONFIG, AppConfig, HERO_DI_CONFIG } from './app.config'; @@ -21,7 +21,7 @@ let template = '{{log}}'; providers: [Logger] // #enddocregion providers-1, providers-logger }) -export class ProviderComponent1 { +export class Provider1Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with Logger class'); @@ -38,7 +38,7 @@ export class ProviderComponent1 { [{ provide: Logger, useClass: Logger }] // #enddocregion providers-3 }) -export class ProviderComponent3 { +export class Provider3Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useClass:Logger'); @@ -57,7 +57,7 @@ class BetterLogger extends Logger {} [{ provide: Logger, useClass: BetterLogger }] // #enddocregion providers-4 }) -export class ProviderComponent4 { +export class Provider4Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useClass:BetterLogger'); @@ -87,7 +87,7 @@ class EvenBetterLogger extends Logger { { provide: Logger, useClass: EvenBetterLogger }] // #enddocregion providers-5 }) -export class ProviderComponent5 { +export class Provider5Component { log: string; constructor(logger: Logger) { logger.log('Hello from EvenBetterlogger'); @@ -114,7 +114,7 @@ class OldLogger { { provide: OldLogger, useClass: NewLogger}] // #enddocregion providers-6a }) -export class ProviderComponent6a { +export class Provider6aComponent { log: string; constructor(newLogger: NewLogger, oldLogger: OldLogger) { if (newLogger === oldLogger){ @@ -137,7 +137,7 @@ export class ProviderComponent6a { { provide: OldLogger, useExisting: NewLogger}] // #enddocregion providers-6b }) -export class ProviderComponent6b { +export class Provider6bComponent { log: string; constructor(newLogger: NewLogger, oldLogger: OldLogger) { if (newLogger !== oldLogger){ @@ -165,7 +165,7 @@ let silentLogger = { [{ provide: Logger, useValue: silentLogger }] // #enddocregion providers-7 }) -export class ProviderComponent7 { +export class Provider7Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useValue'); @@ -179,13 +179,13 @@ export class ProviderComponent7 { template: template, providers: [heroServiceProvider, Logger, UserService] }) -export class ProviderComponent8 { +export class Provider8Component { + // must be true else this component would have blown up at runtime + log = 'Hero service injected successfully via heroServiceProvider'; + // #docregion provider-8-ctor constructor(heroService: HeroService) { } // #enddocregion provider-8-ctor - - // must be true else this component would have blown up at runtime - log = 'Hero service injected successfully via heroServiceProvider'; } ///////////////// @@ -202,7 +202,7 @@ export class ProviderComponent8 { providers: [{ provide: APP_CONFIG, useValue: HERO_DI_CONFIG }] // #enddocregion providers-9 }) -export class ProviderComponent9 { +export class Provider9Component implements OnInit { log: string; /* // #docregion provider-9-ctor-interface @@ -225,13 +225,13 @@ export class ProviderComponent9 { import { Optional } from '@angular/core'; // #enddocregion import-optional -let some_message: string = 'Hello from the injected logger'; +let some_message = 'Hello from the injected logger'; @Component({ selector: 'provider-10', template: template }) -export class ProviderComponent10 { +export class Provider10Component implements OnInit { log: string; // #docregion provider-10-ctor constructor(@Optional() private logger: Logger) { @@ -263,16 +263,16 @@ export class ProviderComponent10 {
      `, directives: [ - ProviderComponent1, - ProviderComponent3, - ProviderComponent4, - ProviderComponent5, - ProviderComponent6a, - ProviderComponent6b, - ProviderComponent7, - ProviderComponent8, - ProviderComponent9, - ProviderComponent10, + Provider1Component, + Provider3Component, + Provider4Component, + Provider5Component, + Provider6aComponent, + Provider6bComponent, + Provider7Component, + Provider8Component, + Provider9Component, + Provider10Component, ], }) export class ProvidersComponent { } diff --git a/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts b/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts index 67850d5749..308bc4547b 100644 --- a/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts +++ b/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts @@ -8,7 +8,7 @@ import { Component } from '@angular/core'; // Location of the template for this component templateUrl: 'app/hello_world.html' }) -export class HelloWorld { +export class HelloWorldComponent { // Declaring the variable for binding with initial value yourName: string = ''; diff --git a/public/docs/_examples/homepage-hello-world/ts/app/main.ts b/public/docs/_examples/homepage-hello-world/ts/app/main.ts index 625a9c338f..c0b99d1b7b 100644 --- a/public/docs/_examples/homepage-hello-world/ts/app/main.ts +++ b/public/docs/_examples/homepage-hello-world/ts/app/main.ts @@ -1,6 +1,6 @@ // #docregion import { bootstrap } from '@angular/platform-browser-dynamic'; -import { HelloWorld } from './hello_world'; +import { HelloWorldComponent } from './hello_world'; -bootstrap(HelloWorld); +bootstrap(HelloWorldComponent); diff --git a/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts b/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts index 1e170bcd6f..cbf2e6db57 100644 --- a/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts +++ b/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { UiTabs, UiPane } from './ui_tabs'; +import { UiTabsComponent, UiPaneDirective } from './ui_tabs'; class Detail { title: string; @@ -13,23 +13,23 @@ class Detail { template: `

      Tabs Demo

      -