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


TypeScript HttpHeaders.get方法代码示例

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


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

示例1: paginateTimeTasks

 private paginateTimeTasks(data: ITimeTask[], headers: HttpHeaders) {
     this.links = this.parseLinks.parse(headers.get('link'));
     this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
     for (let i = 0; i < data.length; i++) {
         this.timeTasks.push(data[i]);
     }
 }
开发者ID:crille,项目名称:konsultklockan,代码行数:7,代码来源:time-task.component.ts

示例2: paginateOperations

 protected paginateOperations(data: IOperation[], headers: HttpHeaders) {
     this.links = this.parseLinks.parse(headers.get('link'));
     this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
     for (let i = 0; i < data.length; i++) {
         this.operations.push(data[i]);
     }
 }
开发者ID:hmessafi,项目名称:jhipster-sample-app,代码行数:7,代码来源:operation.component.ts

示例3: getBearerRealm

    // Returns the URL from the returned www-authenticate that should
    // be called to authenticate the caller.
    private getBearerRealm(headers: HttpHeaders): string {
        if (! headers.has('www-authenticate')) {
            return;
        }

        let authHeader: string = headers.get('www-authenticate');
        let authHeaderValues = authHeader.replace(' ', '').split(',');

        if (authHeaderValues.length === 0) {
            return;
        }
        
        authHeaderValues = authHeaderValues[0].split('=');
        if (authHeaderValues.length !== 2 || authHeaderValues[0] !== 'realm') {
            return null;
        }

        return authHeaderValues[1];
    }
开发者ID:grecosoft,项目名称:Sandbox,代码行数:21,代码来源:ApiClient.ts

示例4: getUsrsList

 getUsrsList(tableFilter) {
   let url = `${environment.url}users`;
   let headers = new HttpHeaders();
   let params = new HttpParams();
   for (var i =0; i < tableFilter.length; i++) {
     const obj = tableFilter[i];
     const key =  Object.keys(obj)[0];
     params = params.append(key, obj[key]);
   }
 //  params = params.append('department', 'product');
 //  params = params.append('department', 'Dept');
  // params['order-by'] = 'firstName,desc';
   headers = headers.set('X-Jwt-Token',environment.token);
   console.log(headers.get('X-Jwt-Token'));
   return this.http.get(url, {
     headers: headers,
     params: params
   });
 }
开发者ID:pssubashps,项目名称:angular-filter-demo,代码行数:19,代码来源:api.service.ts

示例5: paginateHistoryMessages

 private paginateHistoryMessages(data: IHistoryMessage[], headers: HttpHeaders) {
     this.links = this.parseLinks.parse(headers.get('link'));
     this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
     this.queryCount = this.totalItems;
     this.historyMessages = data;
 }
开发者ID:gjik911,项目名称:git_01,代码行数:6,代码来源:history-message.component.ts

示例6: paginateTodos

 private paginateTodos(data: ITodo[], headers: HttpHeaders) {
     this.links = this.parseLinks.parse(headers.get('link'));
     this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
     this.queryCount = this.totalItems;
     this.todos = data;
 }
开发者ID:mantonaci,项目名称:jhipster5java10,代码行数:6,代码来源:todo.component.ts

示例7: paginateRestaurantes

 protected paginateRestaurantes(data: IRestaurante[], headers: HttpHeaders) {
   this.links = this.parseLinks.parse(headers.get('link'));
   this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
   this.restaurantes = data;
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:5,代码来源:restaurante.component.ts

示例8: paginateCartaoCreditos

 protected paginateCartaoCreditos(data: ICartaoCredito[], headers: HttpHeaders) {
   this.links = this.parseLinks.parse(headers.get('link'));
   this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
   this.cartaoCreditos = data;
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:5,代码来源:cliente-cartao.component.ts

示例9: paginateMunicipios

 protected paginateMunicipios(data: IMunicipio[], headers: HttpHeaders) {
   this.links = this.parseLinks.parse(headers.get('link'));
   this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
   this.municipios = data;
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:5,代码来源:municipio.component.ts

示例10: paginateAclClasses

 protected paginateAclClasses(data: IAclClass[], headers: HttpHeaders) {
     this.links = this.parseLinks.parse(headers.get('link'));
     this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
     this.queryCount = this.totalItems;
     this.aclClasses = data;
 }
开发者ID:timstoner,项目名称:taskapp,代码行数:6,代码来源:acl-class.component.ts


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