本文整理汇总了TypeScript中angular2-jwt.AuthHttp.delete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AuthHttp.delete方法的具体用法?TypeScript AuthHttp.delete怎么用?TypeScript AuthHttp.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2-jwt.AuthHttp
的用法示例。
在下文中一共展示了AuthHttp.delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: delete
delete(url) {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
return this._authHttp.delete(url, {
headers: headers
});
}
示例2: removeMember
/** Removes the given member of the party. */
removeMember(party: Party, member: Member): Observable<Member> {
return this.http.delete(`${API_URL}/${party._key}/${member._key}`)
.map((res: Response) => {
const json = res.json();
const member = Deserialize(json, Member);
return member;
});
}
示例3: remove
/** Deletes the given political party. */
remove(party: Party): Observable<Party> {
return this.http.delete(`${API_URL}/${party._key}`)
.map((res: Response) => {
const json = res.json();
const party = Deserialize(json, Party);
return party;
});
}
示例4: unfollow
/** Unfollows the given user. */
unfollow(user: User): Observable<any> {
const url = `${API_URL}/${user._key}/follow`;
return this.http.delete(url)
.map((res: Response) => {
const removed = res.json();
return removed;
});
}
示例5: deleteTest
deleteTest(test) {
console.log(test);
let url = 'http://localhost:8080/api/adTest/' + test.id;
this.authHttp.delete(url)
.subscribe(
response => {
let r = response.json().response;
this.loadUserTests();
},
error => this.response = error.text()
);
}
示例6: removeFromCart
removeFromCart(id): Observable<any> {
const productUrl = `/api/user/cart/remove/${id}`;
return this.authHttp.delete(productUrl)
.map((res: Response) => res.json())
.map(res => {
if (res.success) {
const cart = res.cart || 0;
if (typeof window !== 'undefined') {
localStorage.setItem('id_cart', cart);
}
this.navService.changeCart(cart);
return true;
}
return false;
});
}
示例7: deleteJob
// Delete an identifier from a person
public deleteJob(personId:Number, jobId:Number):Observable<Object> {
return this.http.delete(
env.apiRoot + '/person/' + personId + '/job/' + jobId
).map(res=>res.json());
}
示例8: deleteLink
// Delete an identifier from a person
public deleteLink(personId:Number, linkId:Number):Observable<any> {
return this.http.delete(
env.apiRoot + '/link/' + linkId
).map(res=>res.json());
}
示例9: delete
delete(company: Company) {
return this.http.delete(this.conf.companyByIdURL(company.id))
.toPromise()
.then(response => response.json())
}
示例10: delete
public delete(url: string, options?: RequestOptionsArgs): Observable<Response> {
return this.http.delete(url, options).catch((error) =>
error.status === 401 ?
this.tokenService.mustUpdateToken().flatMap((data: any) => this.delete(url, options)) :
Observable.throw(error));
}