本文整理汇总了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]);
}
}
示例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]);
}
}
示例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];
}
示例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
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}