Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular api delete request

/** 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 by angular.io #
 
PREVIOUS NEXT
Tagged: #angular #api #delete #request
ADD COMMENT
Topic
Name
9+5 =