import { HttpClient } from '@angular/common/http'; updateUser(id: string, user: User): Observable{ return this.http.put (`/users/${id}`, user); }
import { HttpClient } from '@angular/common/http'; updateProperty(id: string, property: string, value: any): ObservableIn this example, we are updating a specific property on an object on the server. We pass in the id of the object, the property we want to update, and the new value for that property. We use an object literal to create the updated object and pass it to the put method. Overall, the @angular/http Http put method is used to update data on the server and makes use of the HttpClientModule package library in Angular.{ return this.http.put(`/items/${id}`, {[property]: value}); }