问题描述
我正在尝试使用 angular services delete
方法删除客户,但我不知道如何从 angular 组件动态传递 id
参数。谁能告诉我如何动态传递 id
?
deleteCustomerById(id: number): Observable<number>
{
const httpOptions =
{
headers: new HttpHeaders({ 'Content-Type': 'application/json'})
};
return this.http.delete<number>('http://localhost:58274/api/Customers/{id}' + id,httpOptions);
}