From 2ca77d80ece0199f0da71c7a72cf7e3d958a507c Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Wed, 7 Feb 2018 15:41:16 -0500 Subject: [PATCH] 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 | 39 +- .../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 | 845 ++++++++---------- 14 files changed, 461 insertions(+), 506 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 1772861c85..39b074c178 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 1e98354842..79410c4a6d 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

-
+