@@ -494,9 +494,9 @@ a#data-model-form-model
494
494
+ makeExample('reactive-forms/ts/app/hero-detail-5.component.ts' , 'imports' )( format ="." )
495
495
496
496
:marked
497
- # Ward, `hero-detail-5.component.ts` is where `@Input() hero: Hero;`
498
- # shows up for the first time, but I don't understand it or know where
499
- # I should mention it. It seems like this is the general area, but we don't demonstrate it.
497
+ ## Ward, `hero-detail-5.component.ts` is where `@Input() hero: Hero;`
498
+ ## shows up for the first time, but I don't understand it or know where
499
+ ## I should mention it. It seems like this is the general area, but we don't demonstrate it.
500
500
501
501
.l-main-section
502
502
a#set-data
@@ -585,6 +585,16 @@ a#set-data
585
585
586
586
+ makeExample('reactive-forms/ts/app/hero-detail-6.component.ts' , 'set-value-on-changes' ,'app/hero-detail.component.ts (excerpt)' )( format ="." )
587
587
588
+ :marked
589
+ You could, however, reset the value of the *formControls* in the `reset()`
590
+ method by refactoring.
591
+ ## Ward, are the benefits that now you can dispense with `setValue` (so less code
592
+ ## and you don't have to set everything)? In `hero-detail-7.component.ts`, we also have
593
+ ## `this.setAddresses(this.hero.addresses);` in `ngOnChanges`.
594
+ ## Do I need to include it and talk about it?
595
+
596
+ + makeExample('reactive-forms/ts/app/hero-detail-7.component.ts' , 'reset-refactor' ,'app/hero-detail.component.ts (excerpt)' )( format ="." )
597
+
588
598
a#hero-list
589
599
:marked
590
600
### Create the _HeroListComponent_ and _HeroService_
@@ -834,7 +844,7 @@ figure.image-display
834
844
Instead, it must prepare `saveHero` whose values derive from a combination of original hero values (the `hero.id`)
835
845
and deep copies of the potentially-changed form model values.
836
846
837
- # Ward, stop lecturing :D
847
+ ## Ward, stop lecturing :D
838
848
839
849
+ makeExample('reactive-forms/ts/app/hero-detail.component.ts' , 'prepare-save-hero' ,'app/hero-detail.component.ts (prepareSaveHero)' )( format ="." )
840
850
0 commit comments