Angular 4 - HTTP delete not working

后端 未结 2 760
夕颜
夕颜 2021-02-14 16:05

I am trying to create a MEAN crud operation. I have an api in node with the delete http method as so localhost:3000/api/user?id=. Below is t

2条回答
  •  有刺的猬
    2021-02-14 16:49

    If you are calling this method inside your component, use .subscribe()

    this.userService.deleteUser(user).subscribe(() => console.log("user deleted")); this.errorMessage = error);
    

提交回复
热议问题