Angular Tour of heroes: ai continué sur HTTP

* ajout d'un héro
  * suppression d'un héro
  * mise à jour d'un héro
This commit is contained in:
2019-10-27 11:54:33 +01:00
parent 81405d7daa
commit 286898f2eb
6 changed files with 102 additions and 0 deletions

View File

@ -10,6 +10,7 @@
</div>
<button (click)="goBack()">go back</button>
<button (click)="save()">save</button>
</div>

View File

@ -33,4 +33,8 @@ export class HeroDetailComponent implements OnInit {
this.location.back();
}
save(): void {
this.heroService.updateHero(this.hero)
.subscribe(() => this.goBack());
}
}