docs: fix formatting (#31120)

PR Close #31120
This commit is contained in:
Kapunahele Wong 2019-06-21 16:37:14 -04:00 committed by Kara Erickson
parent 02d98ed823
commit a1d436e6a4
1 changed files with 8 additions and 3 deletions

View File

@ -20,7 +20,8 @@ export class HeroesComponent implements OnInit {
}
getHeroes(): void {
this.heroesService.getHeroes().subscribe(heroes => (this.heroes = heroes));
this.heroesService.getHeroes()
.subscribe(heroes => (this.heroes = heroes));
}
add(name: string): void {
@ -42,7 +43,9 @@ export class HeroesComponent implements OnInit {
delete(hero: Hero): void {
this.heroes = this.heroes.filter(h => h !== hero);
// #docregion delete-hero-subscribe
this.heroesService.deleteHero(hero.id).subscribe();
this.heroesService
.deleteHero(hero.id)
.subscribe();
// #enddocregion delete-hero-subscribe
/*
// #docregion delete-hero-no-subscribe
@ -67,7 +70,9 @@ export class HeroesComponent implements OnInit {
update() {
if (this.editHero) {
this.heroesService.updateHero(this.editHero).subscribe(hero => {
this.heroesService
.updateHero(this.editHero)
.subscribe(hero => {
// replace the hero in the heroes list with update from server
const ix = hero ? this.heroes.findIndex(h => h.id === hero.id) : -1;
if (ix > -1) {