Good evening! I'm new to programming and I'm not able to make a change to a content with the PUT, this code is inside service.ts
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import "rxjs/add/operator/toPromise";
import { Livro } from "../livro/Livro";
@Injectable()
export class LivroService {
urlApi = "http://localhost:3000/livros";
constructor(private http: HttpClient) { }
Alterar(): Promise<Livro[]> {
return this.http
.put(this.urlApi)
.toPromise()
.then(resposta => Promise.resolve(resposta))
.catch(this.lidaComErro);
}