From 311232004c6bba43bd460ef3df3891c370903620 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Thu, 22 Feb 2018 11:08:07 -0500 Subject: [PATCH 01/10] docs: add HeroService to code tabs and fix headers (#22373) PR Close #22373 --- aio/content/tutorial/toh-pt5.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/aio/content/tutorial/toh-pt5.md b/aio/content/tutorial/toh-pt5.md index d630c251a5f9e..27eb7eab9dec3 100644 --- a/aio/content/tutorial/toh-pt5.md +++ b/aio/content/tutorial/toh-pt5.md @@ -15,7 +15,7 @@ When you’re done, users will be able to navigate the app like this: -## Add the _AppRoutingModule_ +## Add the `AppRoutingModule` An Angular best practice is to load and configure the router in a separate, top-level module that is dedicated to routing and imported by the root `AppModule`. @@ -138,7 +138,7 @@ You should see the familiar heroes master/detail view. {@a routerlink} -## Add a navigation link (_routerLink_) +## Add a navigation link (`routerLink`) Users shouldn't have to paste a route URL into the address bar. They should be able to click a link to navigate. @@ -283,7 +283,7 @@ The user should be able to get to these details in three ways. In this section, you'll enable navigation to the `HeroDetailsComponent` and liberate it from the `HeroesComponent`. -### Delete _hero details_ from _HeroesComponent_ +### Delete _hero details_ from `HeroesComponent` When the user clicks a hero item in the `HeroesComponent`, the app should navigate to the `HeroDetailComponent`, @@ -325,7 +325,7 @@ At this point, all application routes are in place. title="src/app/app-routing.module.ts (all routes)"> -### _DashboardComponent_ hero links +### `DashboardComponent` hero links The `DashboardComponent` hero links do nothing at the moment. @@ -343,7 +343,7 @@ to insert the current interation's `hero.id` into each [`routerLink`](#routerlink). {@a heroes-component-links} -### _HeroesComponent_ hero links +### `HeroesComponent` hero links The hero items in the `HeroesComponent` are `
  • ` elements whose click events are bound to the component's `onSelect()` method. @@ -446,7 +446,7 @@ The browser refreshes and the app crashes with a compiler error. `HeroService` doesn't have a `getHero()` method. Add it now. -### Add *HeroService.getHero()* +### Add `HeroService.getHero()` Open `HeroService` and add this `getHero()` method @@ -518,7 +518,7 @@ Here are the code files discussed on this page and your app should look like thi {@a approutingmodule} {@a appmodule} -#### _AppRoutingModule_ and _AppModule_ +#### _AppRoutingModule_, _AppModule_, and _HeroService_ + + {@a appcomponent} @@ -565,6 +569,7 @@ Here are the code files discussed on this page and your app should look like thi {@a heroescomponent} #### _HeroesComponent_ + From a1efc27ff2de3a443cea4941fab940b4d76903f7 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 7 Mar 2018 17:26:03 -0800 Subject: [PATCH 02/10] ci: double our cores on CircleCI (#22641) This should cut our build time in ~half, assuming it's widely parallel. See https://circleci.com/docs/2.0/configuration-reference/#resource_class Also enable bazel repository caching, and store the external repositories in the CircleCI cache for later builds. PR Close #22641 --- .circleci/bazel.rc | 9 +++++++-- .circleci/config.yml | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc index 921c6293cf367..58e0802184761 100644 --- a/.circleci/bazel.rc +++ b/.circleci/bazel.rc @@ -15,11 +15,16 @@ build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:764 # Prevent unstable environment variables from tainting cache keys build --experimental_strict_action_env +# Save downloaded repositories such as the go toolchain +# This directory can then be included in the CircleCI cache +# It should save time running the first build +build --experimental_repository_cache=/home/circleci/bazel_repository_cache + # Workaround https://github.com/bazelbuild/bazel/issues/3645 # Bazel doesn't calculate the memory ceiling correctly when running under Docker. -# Limit Bazel to consuming resources that fit in CircleCI "medium" class which is the default: +# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class # https://circleci.com/docs/2.0/configuration-reference/#resource_class -build --local_resources=3072,2.0,1.0 +build --local_resources=14336,8.0,1.0 # Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309 test --flaky_test_attempts=2 diff --git a/.circleci/config.yml b/.circleci/config.yml index dcc04f93e19b7..74d5260504957 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ # If you change the `docker_image` version, also change the `cache_key` suffix and the version of # `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file. var_1: &docker_image angular/ngcontainer:0.1.0 -var_2: &cache_key angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.1.0 +var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.1.0 # See remote cache documentation in /docs/BAZEL.md var_3: &setup-bazel-remote-cache @@ -59,7 +59,7 @@ jobs: build: <<: *job_defaults - resource_class: large + resource_class: xlarge steps: - checkout: <<: *post_checkout @@ -71,6 +71,7 @@ jobs: - restore_cache: key: *cache_key + - run: ls /home/circleci/bazel_repository_cache || true - run: bazel info release - run: bazel run @yarn//:yarn # Use bazel query so that we explicitly ask for all buildable targets to be built as well @@ -82,6 +83,7 @@ jobs: key: *cache_key paths: - "node_modules" + - "~/bazel_repository_cache" workflows: version: 2 From 6d9a4f8aea2e1f159ad43b8bd967dab088ff5d42 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Wed, 7 Feb 2018 15:41:16 -0500 Subject: [PATCH 03/10] docs: refactor revert() and call to lifecylce hook, edit doc to changes (#22094) PR Close #22094 --- .../reactive-forms/src/app/app.module.ts | 30 +- .../hero-detail/hero-detail-2.component.html | 2 +- .../hero-detail/hero-detail-3.component.html | 4 +- .../hero-detail/hero-detail-4.component.html | 2 +- .../hero-detail/hero-detail-5.component.html | 2 +- .../hero-detail/hero-detail-6.component.html | 2 +- .../hero-detail/hero-detail-6.component.ts | 12 +- .../hero-detail/hero-detail-7.component.html | 2 +- .../hero-detail/hero-detail-7.component.ts | 31 +- .../hero-detail/hero-detail-8.component.html | 4 +- .../hero-detail/hero-detail-8.component.ts | 8 +- .../hero-detail/hero-detail.component.html | 4 +- .../app/hero-detail/hero-detail.component.ts | 11 +- aio/content/guide/reactive-forms.md | 785 ++++++++---------- 14 files changed, 427 insertions(+), 472 deletions(-) diff --git a/aio/content/examples/reactive-forms/src/app/app.module.ts b/aio/content/examples/reactive-forms/src/app/app.module.ts index 1772861c8529b..39b074c178004 100644 --- a/aio/content/examples/reactive-forms/src/app/app.module.ts +++ b/aio/content/examples/reactive-forms/src/app/app.module.ts @@ -6,32 +6,38 @@ import { BrowserModule } from '@angular/platform-browser'; import { ReactiveFormsModule } from '@angular/forms'; // <-- #1 import module import { AppComponent } from './app.component'; -import { HeroDetailComponent } from './hero-detail/hero-detail.component'; // <-- #1 import component +import { HeroDetailComponent } from './hero-detail/hero-detail.component'; // #enddocregion v1 +// #docregion hero-service-list +// add JavaScript imports import { HeroListComponent } from './hero-list/hero-list.component'; - -import { HeroService } from './hero.service'; // <-- #1 import service +import { HeroService } from './hero.service'; // #docregion v1 @NgModule({ - imports: [ - BrowserModule, - ReactiveFormsModule // <-- #2 add to @NgModule imports - ], declarations: [ AppComponent, HeroDetailComponent, // #enddocregion v1 - HeroListComponent + HeroListComponent // <--declare HeroListComponent // #docregion v1 ], -// #enddocregion v1 - exports: [ // export for the DemoModule + // #enddocregion hero-service-list + imports: [ + BrowserModule, + ReactiveFormsModule // <-- #2 add to @NgModule imports + ], + // #enddocregion v1 + // export for the DemoModule + // #docregion hero-service-list + // ... + exports: [ AppComponent, HeroDetailComponent, - HeroListComponent + HeroListComponent // <-- export HeroListComponent ], - providers: [ HeroService ], // <-- #4 provide HeroService + providers: [ HeroService ], // <-- provide HeroService +// #enddocregion hero-service-list // #docregion v1 bootstrap: [ AppComponent ] }) diff --git a/aio/content/examples/reactive-forms/src/app/hero-detail/hero-detail-2.component.html b/aio/content/examples/reactive-forms/src/app/hero-detail/hero-detail-2.component.html index 1e98354842524..79410c4a6d68e 100644 --- a/aio/content/examples/reactive-forms/src/app/hero-detail/hero-detail-2.component.html +++ b/aio/content/examples/reactive-forms/src/app/hero-detail/hero-detail-2.component.html @@ -1,7 +1,7 @@

    Hero Detail

    FormControl in a FormGroup

    -
    +