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:
@ -10,6 +10,7 @@
|
||||
</div>
|
||||
|
||||
<button (click)="goBack()">go back</button>
|
||||
<button (click)="save()">save</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -33,4 +33,8 @@ export class HeroDetailComponent implements OnInit {
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
save(): void {
|
||||
this.heroService.updateHero(this.hero)
|
||||
.subscribe(() => this.goBack());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user