Change data with Put in angle 5

0

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);
  }
    
asked by anonymous 23.04.2018 / 01:04

0 answers