docs(API): 翻译完了 HttpHeaders

This commit is contained in:
Zhicheng Wang 2018-09-02 19:31:59 +08:00
parent 8cea4a3646
commit 6312e38a63
2 changed files with 19 additions and 1 deletions

View File

@ -35,7 +35,7 @@
[x] | common/NgStyle | 0.60
[x] | router/RouterOutlet | 0.59
[x] | forms/Validators | 0.59
[ ] | common/http/HttpHeaders | 0.56
[x] | common/http/HttpHeaders | 0.56
[x] | core/Pipe | 0.52
[ ] | common/NgSwitch | 0.52
[ ] | forms/NgForm | 0.50

View File

@ -15,10 +15,14 @@ interface Update {
/**
* Immutable set of Http headers, with lazy parsing.
*
* Http
*
*/
export class HttpHeaders {
/**
* Internal map of lowercase header names to values.
*
* key value
*/
// TODO(issue/24571): remove '!'.
private headers !: Map<string, string[]>;
@ -27,17 +31,23 @@ export class HttpHeaders {
/**
* Internal map of lowercased header names to the normalized
* form of the name (the form seen first).
*
* key
*/
private normalizedNames: Map<string, string> = new Map();
/**
* Complete the lazy initialization of this object (needed before reading).
*
*
*/
// TODO(issue/24571): remove '!'.
private lazyInit !: HttpHeaders | Function | null;
/**
* Queued updates to be materialized the next initialization.
*
*
*/
private lazyUpdate: Update[]|null = null;
@ -82,6 +92,8 @@ export class HttpHeaders {
/**
* Checks for existence of header by given name.
*
*
*/
has(name: string): boolean {
this.init();
@ -91,6 +103,8 @@ export class HttpHeaders {
/**
* Returns first header that matches given name.
*
*
*/
get(name: string): string|null {
this.init();
@ -101,6 +115,8 @@ export class HttpHeaders {
/**
* Returns the names of the headers
*
*
*/
keys(): string[] {
this.init();
@ -110,6 +126,8 @@ export class HttpHeaders {
/**
* Returns list of header values for a given name.
*
*
*/
getAll(name: string): string[]|null {
this.init();