Question : http delete angular
Answered by : rasel-ahmed-9kilyai1mdfd
ngOnInit() { this.http.delete('https://jsonplaceholder.typicode.com/posts/1') .subscribe(() => this.status = 'Delete successful');
}
Source : https://jasonwatmore.com/post/2020/10/10/angular-http-delete-request-examples | Last Update : Mon, 27 Jun 22
Question : angular api delete request
Answered by : duck-head
/** In the Api Service */
/** DELETE: delete the hero from the server */
deleteHero(id: number): Observable<unknown> { const url = "http://apiurl/" + id; /** DELETE api/heroes/42 */ return this.http.delete(url, httpOptions).pipe();
}
/** In the component */
this.heroesService.deleteHero(hero.id).subscribe();
Source : https://angular.io/guide/http | Last Update : Thu, 15 Sep 22