本文整理汇总了TypeScript中angular2/http.Http.delete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Http.delete方法的具体用法?TypeScript Http.delete怎么用?TypeScript Http.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/http.Http
的用法示例。
在下文中一共展示了Http.delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: deleteBlogEntry
deleteBlogEntry(id: number): Observable<Response> {
return this.http.delete('/api/blogs/' + id)
}
示例2: deleteJSON
deleteJSON(url: string, cb: ServerResponse): void {
this.http.delete(url)
.subscribe((res: Response) => {
cb(res.json()); //callBack
});
} //deleteJSON
示例3: unfavorite
unfavorite(item) {
return this.http.delete(favoritesURL + item.id).map(res => res.json()).catch(this.handleError);
}
示例4: deleteFamily
deleteFamily(id) {
return this._http.delete("/api/products/family/" + id)
.map(response => response.json());
}
示例5: delete
public delete(p:Post) {
return this._http
.delete('./api/posts/' + p._id,
this._headerService.getJsonHeaders(this._loginService.getToken()))
.map(res => res.json())
}
示例6: deleteAllData
deleteAllData(): Observable<any> {
const token = localStorage.getItem('token') !== null ? '?auth=' + localStorage.getItem('token') : '';
return this._http.delete('https://a2-dev.firebaseio.com/users/data.json' + token)
.map(response => response.json());
}
示例7: deleteProduct
deleteProduct(id) {
return this._http.delete("api/products/id/" + id)
.map(response => response.json());
}
示例8: deleteStudent
deleteStudent(student: Student): Observable<Response> {
return this.http.delete('http://localhost:8080/api/student/'+student.id);
}
示例9: delete
delete(url:string, defaultOptions?: RequestOptions): Observable<Response> {
let options:RequestOptions = this.manageRequestOptions(defaultOptions);
return this.http.delete(rootUrl+url, options);
}
示例10: deleteItem
deleteItem(item: Item) {
return this.http.delete(`${BASE_URL}${item.id}`)
.map(res => res.json())
.toPromise();
}