當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Http.patch方法代碼示例

本文整理匯總了TypeScript中@angular/http.Http.patch方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Http.patch方法的具體用法?TypeScript Http.patch怎麽用?TypeScript Http.patch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/http.Http的用法示例。


在下文中一共展示了Http.patch方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: patch

  patch(
    action: string,
    body = '',
    headers: { [key: string]: string } = {}
  ): Observable<any> {
    let url: string = environment['api'] + action

    headers['Content-Type'] = 'application/json'

    let options = new RequestOptions({
      headers: new Headers(headers),
    })

    return this._http
      .patch(url, body, options)
      .map(this._extract)
      .catch(this._handleError)
  }
開發者ID:emesonsantana,項目名稱:bmp1-web-service,代碼行數:18,代碼來源:http.service.ts

示例2: patch

 patch(url: string, body: any, options?: RequestOptionsArgs) {
     options = this.getOptions(options);
     return this.http.patch(url, body, options);
 }
開發者ID:giggio,項目名稱:transempregos-portal,代碼行數:4,代碼來源:httpAuth.ts

示例3: patch

 patch(url: string, body: string, options?: RequestOptions): Observable<Response> {
   return this.http.patch(this.url(url), body, this.requestOptions(options));
 }
開發者ID:tb,項目名稱:ng2-api,代碼行數:3,代碼來源:api-http.ts

示例4: updateData

 private updateData(data_url, data): Promise<any> {
   return this.http.patch(data_url, data)
     .toPromise()
     .then(this.extractData)
     .catch(this.handleError);
 }
開發者ID:ObsidianCat,項目名稱:time_travel_vacation,代碼行數:6,代碼來源:destination-data-handler.service.ts

示例5: updateDraft

 /**
  * Update an existing draft with new information.
  * PATCH: /api/drafts/update
  *
  * @param draft The draft to update.
  * @returns {Observable<Draft>}   The draft returned from the server.
  */
 public updateDraft(draft : Draft) : Observable<Draft> {
     return this.http.patch('/api/drafts/update', draft, this.headersWithAuth())
         .map(this.parseJson)
         .map(this.createDraftModel)
         .catch(this.handleError);
 }
開發者ID:LukeNZ,項目名稱:onerocketroad,代碼行數:13,代碼來源:DraftService.service.ts

示例6: patchElement

 patchElement(id: string, element: any) {
     return this.http.patch(id, element, { headers: this.headers });
 }
開發者ID:plomino,項目名稱:Plomino,代碼行數:3,代碼來源:element.service.ts

示例7: update

 update(post){
   return this.http.patch(this.url+"/"+post.id,JSON.stringify(post))
   .catch(this.hanldeError);
 }
開發者ID:FredJiangFei,項目名稱:myDream,代碼行數:4,代碼來源:data.service.ts

示例8:

 return this.getPostData(url, body, options, (url: string, options: RequestOptionsArgs) => {
     return this.http.patch(url, body.options);
 });
開發者ID:oneuptim,項目名稱:node-amazon,代碼行數:3,代碼來源:transfer-http.ts

示例9: Promise

 return new Promise((resolve, reject) => {
   this.handleRequest(this.http.patch(LoopbackAPI.URL(url, params), JSON.stringify(body), options), resolve, reject);
 });
開發者ID:baijiadu,項目名稱:auktionator,代碼行數:3,代碼來源:loopback-api.ts

示例10: httpPatch

 httpPatch(url: string, body = {}, options = {}) {
   return this.http.patch(this.wpApiLoader.getWebServiceUrl(url), body, options);
 }
開發者ID:shprink,項目名稱:wp-api-angular,代碼行數:3,代碼來源:Parent.ts


注:本文中的@angular/http.Http.patch方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。