当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript HttpClient.patch方法代码示例

本文整理汇总了TypeScript中@angular/common/http.HttpClient.patch方法的典型用法代码示例。如果您正苦于以下问题:TypeScript HttpClient.patch方法的具体用法?TypeScript HttpClient.patch怎么用?TypeScript HttpClient.patch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/common/http.HttpClient的用法示例。


在下文中一共展示了HttpClient.patch方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: modifyContactTag

 modifyContactTag(contactId: number, params): Observable<any> {
     const url = `${Constants.apiContacts}/${contactId}`;
     
     return this.http
         .patch(url, params)
         .pipe(catchError(this.handleError('modifyContactTag', null)));
 }
开发者ID:pete33221100,项目名称:test-project-28032018,代码行数:7,代码来源:contact.service.ts

示例2: updateNote

  public updateNote(note: Note): Observable<Note> {
    const updateNoteUrl = `https://whiteraven.azurewebsites.net/api/notes/${note.id}`;

    return this.http.patch<Response<Note>>(updateNoteUrl, { title: note.title, content: note.content })
      .pipe(
        tap(r => {
          const indexInAll = this.dataStore.allNotes.findIndex(x => x.id === r.data.id);

          this.dataStore.allNotes[indexInAll] = r.data;
          this._allNotes.next([...this.dataStore.allNotes]);

          const indexInMy = this.dataStore.myNotes.findIndex(x => x.id === r.data.id);
          if (indexInMy >= 0) {
            this.dataStore.myNotes[indexInMy] = r.data;
            this._myNotes.next([...this.dataStore.myNotes]);
            return;
          }

          const indexInEditable = this.dataStore.editableNotes.findIndex(x => x.id === r.data.id);
          if (indexInEditable >= 0) {
            this.dataStore.editableNotes[indexInEditable] = r.data;
            this._editableNotes.next([...this.dataStore.editableNotes]);
            return;
          }

          throw new Error('Note was not found in the editable collections');
        }),
        map(r => r.data));
  }
开发者ID:a-vzhik,项目名称:white-raven,代码行数:29,代码来源:note.service.ts

示例3: updateAclString

 updateAclString(rootDn:string, aclStrVal:string){
     let headers = this.authService.getAuthHeader();
     let body  = this.constructSDJsonBody(aclStrVal);
     let url = 'https://' + this.domain + ':' + this.configService.API_PORT + '/v1/vmdir/ldap';
     url += '?dn=' + encodeURIComponent(rootDn);
     console.log(url);
     return this.httpClient.patch(url, body, {headers})
            .share()
            .map((res: Response) => res)
            .catch(this.handleError)
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例4: updateAttributes

 updateAttributes(rootDn:string, originalValMap:Map<string,any>, attribsArr:string[], modifiedAttributesMap:Map<string,any>, schemaMap:Map<string,any>): Observable<string[]> {
     let headers = this.authService.getAuthHeader();
     let body = this.constructJsonBody(originalValMap, attribsArr, modifiedAttributesMap, schemaMap);
     this.getUrl = 'https://' + this.domain + ':' + this.configService.API_PORT + '/v1/vmdir/ldap';
     let updateUrl = this.getUrl + '?dn='+rootDn;
     console.log(updateUrl);
     return this.httpClient.patch(updateUrl, body, {headers})
            .share()
            .map((res: Response) => res)
            .catch(this.handleError)
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: switchMap

 switchMap(user => {
   return this.http.patch('/_api/v1/user/changepassword', {
       old_password: oldPassword,
       new_password: newPassword,
       retype_password: newPassword,
     },
     {
       headers: { 'X-Authorization': 'Bearer ' + user.token }
     }
   );
 })
开发者ID:berta-cms,项目名称:berta,代码行数:11,代码来源:user.service.ts

示例6:

 patch<T>(url: string, body: string): Observable<T> {
     return this.http.patch<T>(url, body);
 }
开发者ID:FabianGosebrink,项目名称:ASPNET-Foodchooser-Cross-Platform-Angular2,代码行数:3,代码来源:httpWrapper.service.ts

示例7:

 patch<TResponseBody>(url: string, data?: any): Observable<HttpResponse<TResponseBody>> {
     return this.httpClient.patch<TResponseBody>(url, JSON.stringify(data), { observe: 'response' });
 }
开发者ID:jbload,项目名称:Muscularity,代码行数:3,代码来源:http-client-wrapper.service.ts

示例8: updateUser

 updateUser(id: any, user: any) {
   return this.http.patch(`${environment.url}/users/${id}`, user);
 }
开发者ID:eluizbr,项目名称:ngCurso,代码行数:3,代码来源:users.service.ts

示例9: changeScheduledTaskStatus

	changeScheduledTaskStatus(scheduledTaskId: number, actionName: string): Promise<void> {
		return this.http.patch('/api/scheduledtasks', { id: scheduledTaskId, action: actionName })
			.toPromise()
			.then(() => null)
			.catch(this.utils.handleResponseError);
	}
开发者ID:iadgov,项目名称:WALKOFF,代码行数:6,代码来源:scheduler.service.ts

示例10: renamePlaybook

	/**
	 * Renames an existing playbook.
	 * @param playbookId Current playbook ID to change
	 * @param newName New name for the updated playbook
	 */
	renamePlaybook(playbookId: string, newName: string): Promise<Playbook> {
		return this.http.patch('/api/playbooks', { id: playbookId, name: newName })
			.toPromise()
			.then((data: object) => plainToClass(Playbook, data))
			.catch(this.utils.handleResponseError);
	}
开发者ID:iadgov,项目名称:WALKOFF,代码行数:11,代码来源:playbook.service.ts


注:本文中的@angular/common/http.HttpClient.patch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。