From 2cd125f40ccd3ae1f389b4f4e37f0e35645f92aa Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Fri, 31 Aug 2018 09:01:12 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E6=94=B9=E8=BF=9B=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E8=A1=8C=E7=BF=BB=E8=AF=91=E6=96=B9=E5=BC=8F=20docs(A?= =?UTF-8?q?PI):=20=E7=BF=BB=E8=AF=91=E4=BA=86=20directive.ts=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=20tsdoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 9 +- .../processors/splitDescription.js | 2 +- packages/common/http/src/client.ts | 785 ++++++++++++------ packages/common/src/directives/ng_for_of.ts | 3 +- packages/core/src/metadata/directives.ts | 335 ++++++++ packages/forms/src/directives/ng_model.ts | 9 +- 6 files changed, 866 insertions(+), 277 deletions(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index be2ffb44b4..0b8544f5d8 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -107,14 +107,7 @@ core/testing/async | 518 | 0.16 找到源码,并且把对应的 tsdoc 内容翻译了。 -注意:tsdoc 中的第一行是标题行,编译时和其它内容不在一起,所以,tsdoc 注释中的第一行必须使用 - -``` -english -

中文

- -``` -的形式进行翻译,后面的描述行则无所谓,可以按照以前的空行分隔的方式进行翻译。 +中文放在英文之后,并且要隔一个空行。 ## 翻译内容 diff --git a/aio/tools/transforms/angular-api-package/processors/splitDescription.js b/aio/tools/transforms/angular-api-package/processors/splitDescription.js index 2d6de6a9fc..74de884425 100644 --- a/aio/tools/transforms/angular-api-package/processors/splitDescription.js +++ b/aio/tools/transforms/angular-api-package/processors/splitDescription.js @@ -12,7 +12,7 @@ module.exports = function splitDescription() { docs.forEach(doc => { if (this.docTypes.indexOf(doc.docType) !== -1 && doc.description !== undefined) { const description = doc.description.trim(); - const endOfParagraph = description.search(/\n\s*\n/); + const endOfParagraph = description.search(/\n\s*\n+(?!.*[\u4e00-\u9fa5])/); // 从第一个非汉字行开始拆分 if (endOfParagraph === -1) { doc.shortDescription = description; doc.description = ''; diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index 177b0a61d6..379552c0a1 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -46,7 +46,8 @@ export type HttpObserve = 'body' | 'events' | 'response'; /** * Perform HTTP requests. - *

执行 HTTP 请求。

+ * + * 执行 HTTP 请求。 * * `HttpClient` is available as an injectable class, with methods to perform HTTP requests. * Each request method has multiple signatures, and the return type varies according to which @@ -62,16 +63,19 @@ export class HttpClient { /** * Send the given `HttpRequest` and return a stream of `HttpEvents`. - *

发送指定的 `HttpRequest` 并返回一个由 `HTTPEvents` 组成的流。

+ * + * 发送指定的 `HttpRequest` 并返回一个由 `HTTPEvents` 组成的流。 */ request(req: HttpRequest): Observable>; /** * Construct a request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ request(method: string, url: string, options: { body?: any, @@ -84,10 +88,12 @@ export class HttpClient { /** * Construct a request which interprets the body as a `Blob` and returns it. - *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ request(method: string, url: string, options: { body?: any, @@ -100,10 +106,12 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns it. - *

构造一个请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ request(method: string, url: string, options: { body?: any, @@ -116,10 +124,12 @@ export class HttpClient { /** * Construct a request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -131,10 +141,12 @@ export class HttpClient { /** * Construct a request which interprets the body as an `Blob` and returns the full event stream. - *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -147,10 +159,12 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns the full event stream. - *

构造一个请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -163,10 +177,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full event stream. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -180,10 +196,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full event stream. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `R`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `R` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `R` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -197,10 +215,12 @@ export class HttpClient { /** * Construct a request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -213,10 +233,12 @@ export class HttpClient { /** * Construct a request which interprets the body as a `Blob` and returns the full response. - *

构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -229,10 +251,12 @@ export class HttpClient { /** * Construct a request which interprets the body as text and returns the full response. - *

构造一个请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -245,10 +269,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full response. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -262,10 +288,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns the full response. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `R`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -279,10 +307,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns it. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ request(method: string, url: string, options?: { body?: any, @@ -296,10 +326,12 @@ export class HttpClient { /** * Construct a request which interprets the body as JSON and returns it. - *

构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `R`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。 */ request(method: string, url: string, options?: { body?: any, @@ -314,10 +346,12 @@ export class HttpClient { /** * Construct a request in a manner where response type and requested `Observable` are not known * statically. - *

以某种方式构造请求,其响应类型和所请求的 `Observable` 都是无法静态获知的。

+ * + * 以某种方式构造请求,其响应类型和所请求的 `Observable` 都是无法静态获知的。 * * @return an `Observable` of whatever was requested, typed to `any`. - *

所请求的任意 `Observable`,其类型是 `any`。

+ * + * 所请求的任意 `Observable`,其类型是 `any`。 */ request(method: string, url: string, options?: { body?: any, @@ -333,7 +367,8 @@ export class HttpClient { * Constructs an `Observable` for a particular HTTP request that, when subscribed, * fires the request through the chain of registered interceptors and on to the * server. - *

为一个特定的 HTTP 请求构造一个 `Observable`,当它被订阅时,就触发该请求,经过一系列已注册的拦截器的处理之后,最终发给服务器。

+ * + * 为一个特定的 HTTP 请求构造一个 `Observable`,当它被订阅时,就触发该请求,经过一系列已注册的拦截器的处理之后,最终发给服务器。 * * This method can be called in one of two ways. Either an `HttpRequest` * instance can be passed directly as the only parameter, or a method can be @@ -494,10 +529,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -510,10 +547,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns it. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -525,10 +564,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns it. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -540,10 +581,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -555,10 +598,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -570,10 +615,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns the full event stream. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -585,10 +632,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full event stream. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -601,10 +650,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full event stream. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -617,10 +668,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -632,10 +685,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -647,10 +702,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as text and returns the full response. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -662,10 +719,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full response. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -678,10 +737,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns the full response. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -694,10 +755,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns it. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -710,10 +773,12 @@ export class HttpClient { /** * Construct a DELETE request which interprets the body as JSON and returns it. - *

构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ delete(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -728,8 +793,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * DELETE request to be executed on the server. See the individual overloads for * details of `delete()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `DELETE` 请求。 - * 关于 `delete()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `DELETE` 请求。 + * 关于 `delete()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -745,10 +811,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -760,10 +828,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns it. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -775,10 +845,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns it. - *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -790,10 +862,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -805,10 +879,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -820,10 +896,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns the full event stream. - *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -835,10 +913,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full event stream. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -851,10 +931,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full event stream. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -867,10 +949,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -882,10 +966,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -897,10 +983,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as text and returns the full response. - *

构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -912,10 +1000,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full response. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -928,10 +1018,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns the full response. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -944,10 +1036,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns it. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -960,10 +1054,12 @@ export class HttpClient { /** * Construct a GET request which interprets the body as JSON and returns it. - *

构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -978,8 +1074,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * GET request to be executed on the server. See the individual overloads for * details of `get()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `GET` 请求。 - * 关于 `get()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `GET` 请求。 + * 关于 `get()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -995,10 +1092,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1009,10 +1108,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns it. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ }): Observable; head(url: string, options: { @@ -1025,10 +1126,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns it. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1040,10 +1143,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1055,10 +1160,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1070,10 +1177,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns the full event stream. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1085,10 +1194,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full event stream. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1101,10 +1212,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full event stream. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1117,10 +1230,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1132,10 +1247,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1147,10 +1264,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as text and returns the full response. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1162,10 +1281,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full response. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1178,10 +1299,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns the full response. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1194,10 +1317,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns it. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1210,10 +1335,12 @@ export class HttpClient { /** * Construct a HEAD request which interprets the body as JSON and returns it. - *

构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1228,8 +1355,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * HEAD request to be executed on the server. See the individual overloads for * details of `head()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `HEAD` 请求。 - * 关于 `head()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `HEAD` 请求。 + * 关于 `head()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1244,26 +1372,31 @@ export class HttpClient { /** * Construct a JSONP request for the given URL and name of the callback parameter. - *

使用指定的 URL 和回调函数名构造一个 JSONP 请求。

+ * + * 使用指定的 URL 和回调函数名构造一个 JSONP 请求。 * * @return an `Observable` of the response object as an `Object` - *

一个 `Object` 型响应对象组成的 `Observable` 对象

+ * + * 一个 `Object` 型响应对象组成的 `Observable` 对象 */ jsonp(url: string, callbackParam: string): Observable; /** * Construct a JSONP request for the given URL and name of the callback parameter. - *

使用指定的 URL 和回调函数名构造一个 JSONP 请求。

+ * + * 使用指定的 URL 和回调函数名构造一个 JSONP 请求。 * * @return an `Observable` of the response object as type `T`. - *

一个 `T` 型响应对象组成的 `Observable` 对象

+ * + * 一个 `T` 型响应对象组成的 `Observable` 对象 */ jsonp(url: string, callbackParam: string): Observable; /** * Constructs an `Observable` which, when subscribed, will cause a request * with the special method `JSONP` to be dispatched via the interceptor pipeline. - *

构造一个 `Observable`,订阅它将经过拦截器管道处理之后发送一个特殊的 `JSONP` 请求。

+ * + * 构造一个 `Observable`,订阅它将经过拦截器管道处理之后发送一个特殊的 `JSONP` 请求。 * * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`). * If no such interceptor is reached, then the `JSONP` request will likely be @@ -1282,10 +1415,12 @@ export class HttpClient { /** * Make an OPTIONS request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1297,10 +1432,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns it. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1312,10 +1449,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns it. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1327,10 +1466,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1342,10 +1483,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1357,10 +1500,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns the full event stream. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1372,10 +1517,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full event stream. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1388,10 +1535,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full event stream. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1404,10 +1553,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1419,10 +1570,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1434,10 +1587,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as text and returns the full response. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1449,10 +1604,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full response. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1465,10 +1622,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns the full response. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1481,10 +1640,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns it. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1497,10 +1658,12 @@ export class HttpClient { /** * Construct an OPTIONS request which interprets the body as JSON and returns it. - *

构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1515,8 +1678,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * OPTIONS request to be executed on the server. See the individual overloads for * details of `options()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `OPTIONS` 请求。 - * 关于 `options()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `OPTIONS` 请求。 + * 关于 `options()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1531,10 +1695,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1546,10 +1712,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns it. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1561,10 +1729,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns it. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1576,10 +1746,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1591,10 +1763,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1606,10 +1780,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns the full event stream. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1621,10 +1797,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full event stream. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1637,10 +1815,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full event stream. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1653,10 +1833,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1668,10 +1850,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1683,10 +1867,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as text and returns the full response. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1698,10 +1884,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full response. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1714,10 +1902,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns the full response. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1730,10 +1920,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns it. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1746,10 +1938,12 @@ export class HttpClient { /** * Construct a PATCH request which interprets the body as JSON and returns it. - *

构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1764,8 +1958,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * PATCH request to be executed on the server. See the individual overloads for * details of `patch()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PATCH` 请求。 - * 关于 `patch()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PATCH` 请求。 + * 关于 `patch()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1780,10 +1975,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1795,10 +1992,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns it. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1810,10 +2009,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns it. - *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1825,10 +2026,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1840,10 +2043,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1855,10 +2060,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns the full event stream. - *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1870,10 +2077,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full event stream. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1886,10 +2095,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full event stream. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1902,10 +2113,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1917,10 +2130,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1932,10 +2147,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as text and returns the full response. - *

构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1947,10 +2164,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full response. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1963,10 +2182,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns the full response. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1979,10 +2200,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns it. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1995,10 +2218,12 @@ export class HttpClient { /** * Construct a POST request which interprets the body as JSON and returns it. - *

构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2013,8 +2238,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * POST request to be executed on the server. See the individual overloads for * details of `post()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `POST` 请求。 - * 关于 `post()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `POST` 请求。 + * 关于 `post()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2029,10 +2255,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns it. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 * * @return an `Observable` of the body as an `ArrayBuffer`. - *

一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2044,10 +2272,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns it. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 * * @return an `Observable` of the body as a `Blob`. - *

一个由 `Blob` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2059,10 +2289,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns it. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回它。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回它。 * * @return an `Observable` of the body as a `string`. - *

一个由 `string` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2074,10 +2306,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns the full event stream. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2089,10 +2323,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns the full event stream. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Blob`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2104,10 +2340,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns the full event stream. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `string`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2119,10 +2357,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full event stream. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `Object`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2135,10 +2375,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full event stream. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 * * @return an `Observable` of all `HttpEvent`s for the request, with a body type of `T`. - *

一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。

+ * + * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2147,10 +2389,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as an `ArrayBuffer` and returns the full response. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `ArrayBuffer`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2162,10 +2406,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as a `Blob` and returns the full response. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Blob`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2177,10 +2423,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as text and returns the full response. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `string`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2192,10 +2440,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full response. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `Object`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2208,10 +2458,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns the full response. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 * * @return an `Observable` of the `HttpResponse` for the request, with a body type of `T`. - *

一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。

+ * + * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2224,10 +2476,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns it. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as an `Object`. - *

一个由 `Object` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2240,10 +2494,12 @@ export class HttpClient { /** * Construct a PUT request which interprets the body as JSON and returns it. - *

构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。

+ * + * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。 * * @return an `Observable` of the body as type `T`. - *

一个由 `T` 型的 body 组成的 `Observable` 对象。

+ * + * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2258,8 +2514,9 @@ export class HttpClient { * Constructs an `Observable` which, when subscribed, will cause the configured * PUT request to be executed on the server. See the individual overloads for * details of `put()`'s return type based on the provided options. - *

构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PUT` 请求。 - * 关于 `put()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。

+ * + * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PUT` 请求。 + * 关于 `put()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, diff --git a/packages/common/src/directives/ng_for_of.ts b/packages/common/src/directives/ng_for_of.ts index 1efa5c3474..ec0f7ea950 100644 --- a/packages/common/src/directives/ng_for_of.ts +++ b/packages/common/src/directives/ng_for_of.ts @@ -26,7 +26,8 @@ export class NgForOfContext { * The `NgForOf` directive instantiates a template once per item from an iterable. The context * for each instantiated template inherits from the outer context with the given loop variable * set to the current item from the iterable. - *

`NgForOf` 指令会为可迭代对象中的每一个条目实例化一个模板。实例化时的上下文环境来自其外部环境,它以当前正在迭代的条目作为循环变量。

+ * + * `NgForOf` 指令会为可迭代对象中的每一个条目实例化一个模板。实例化时的上下文环境来自其外部环境,它以当前正在迭代的条目作为循环变量。 * * ### Local Variables * diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index 7a0bcbe0d8..5a88aadaf5 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -16,6 +16,8 @@ import {ViewEncapsulation} from './view'; /** * Type of the Directive decorator / constructor function. + * + * 指令装饰器、构造函数的类型。 */ export interface DirectiveDecorator { /** @@ -25,13 +27,20 @@ export interface DirectiveDecorator { * how the directive should be processed, instantiated and used at * runtime. * + * 把一个类标记为 Angular 指令。你可以定义自己的指令来为 DOM 中的元素添加自定义行为。 + * 该选项提供配置元数据,用于决定该指令在运行期间要如何处理、实例化和使用。 + * * Directive classes, like component classes, can implement * [life-cycle hoooks](guide/lifecycle-hooks) to influence their configuration and behavior. * + * 像组件类一样,指令类也可以实现[生命周期钩子](guide/lifecycle-hooks),以影响它们的配置和行为。 + * * * @usageNotes * To define a directive, mark the class with the decorator and provide metadata. * + * 要想定义一个指令,请为该类加上此装饰器,并提供元数据。 + * * ``` * import {Directive} from '@angular/core'; * @@ -45,14 +54,22 @@ export interface DirectiveDecorator { * * ### Declaring directives * + * ### 声明指令 + * * Directives are [declarables](guide/glossary#declarable). * They must be declared by an NgModule * in order to be usable in an app. * + * 指令是[可声明对象](guide/glossary#declarable)。 + * 它们必须在 NgModule 中声明之后,才能用在应用中。 + * * A directive must belong to exactly one NgModule. Do not re-declare * a directive imported from another module. * List the directive class in the `declarations` field of an NgModule. * + * 指令应当且只能属于一个 NgModule。不要重新声明那些从其它模块中导入的指令。 + * 请把该指令类列在 NgModule 的 `declarations` 字段中。 + * * ``` * declarations: [ * AppComponent, @@ -66,6 +83,8 @@ export interface DirectiveDecorator { /** * See the `Directive` decorator. + * + * 参见 `Directive` 装饰器中。 */ new (obj: Directive): Directive; } @@ -74,20 +93,44 @@ export interface Directive { /** * The CSS selector that triggers the instantiation of a directive. * + * 这个 CSS 选择器用于触发指令的实例化。 + * * Declare as one of the following: * + * 可使用下列形式之一: + * * - `element-name`: select by element name. + * + * `element-name`:根据元素名选取。 + * * - `.class`: select by class name. + * + * `.class`:根据类名选取。 + * * - `[attribute]`: select by attribute name. + * + * `[attribute]`:根据属性名选取。 + * * - `[attribute=value]`: select by attribute name and value. + * + * `[attribute=value]`:根据属性名和属性值选取。 + * * - `:not(sub_selector)`: select only if the element does not match the `sub_selector`. + * + * `:not(sub_selector)`:只有当元素不匹配子选择器 `sub_selector` 的时候才选取。 + * * - `selector1, selector2`: select if either `selector1` or `selector2` matches. * + * `selector1, selector2`:无论 `selector1` 还是 `selector2` 匹配时都选取。 + * * Angular only allows directives to trigger on CSS selectors that do not cross element * boundaries. For example, consider a directive with an `input[type=text]` selector. * For the following HTML, the directive is instantiated only on the * `` element. * + * Angular 的指令只允许那些不跨元素边界的 CSS 选择器。比如,考虑一个带有 `input[type=text]` 选择器的指令。 + * 对于下列 HTML,该指令只会在 `` 元素上实例化。 + * * ```html *
* @@ -101,20 +144,36 @@ export interface Directive { /** * Enumerates the set of data-bound input properties for a directive * + * 列举某个指令的一组可供数据绑定的输入属性 + * * Angular automatically updates input properties during change detection. * The `inputs` property defines a set of `directiveProperty` to `bindingProperty` * configuration: * + * Angular 会在变更检测期间自动更新输入属性。 + * `inputs` 属性定义了一组从 `directiveProperty` 指向 `bindingProperty` 的配置项: + * * - `directiveProperty` specifies the component property where the value is written. + * + * `directiveProperty` 用于指定要写入值的指令内属性。 + * * - `bindingProperty` specifies the DOM property where the value is read from. * + * `bindingProperty` 用于指定要从中读取值的 DOM 属性。 + * * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`. + * + * 当没有提供 `bindingProperty` 时,就假设它和 `directiveProperty` 一样。 * @usageNotes * * ### Example * + * ### 范例 + * * The following example creates a component with two data-bound properties. * + * 下面的例子创建了一个带有两个可绑定属性的组件。 + * * ```typescript * @Component({ * selector: 'bank-account', @@ -135,19 +194,32 @@ export interface Directive { /** * Enumerates the set of event-bound output properties. * + * 列举一组可供事件绑定的输出属性。 + * * When an output property emits an event, an event handler attached to that event * the template is invoked. * + * 当输出属性发出一个事件时,就会调用模板中附加到它的一个事件处理器。 + * * The `outputs` property defines a set of `directiveProperty` to `bindingProperty` * configuration: * + * `outputs` 属性定义了一组从 `directiveProperty` 指向 `bindingProperty` 的配置项: + * * - `directiveProperty` specifies the component property that emits events. + * + * `directiveProperty` 用于指定要发出事件的指令属性。 + * * - `bindingProperty` specifies the DOM property the event handler is attached to. * + * `bindingProperty` 用于指定要附加事件处理器的 DOM 属性。 + * * @usageNotes * * ### Example * + * ### 范例 + * * ```typescript * @Directive({ * selector: 'child-dir', @@ -169,16 +241,22 @@ export interface Directive { /** * A set of injection tokens that allow the DI system to * provide a dependency to this directive or component. + * + * 一组依赖注入令牌,它允许 DI 系统为这个指令或组件提供依赖。 */ providers?: Provider[]; /** * Defines the name that can be used in the template to assign this directive to a variable. * + * 定义一个名字,用于在模板中把该指令赋值给一个变量。 + * * @usageNotes * * ### Simple Example * + * ### 简单例子 + * * ``` * @Directive({ * selector: 'child-dir', @@ -200,16 +278,25 @@ export interface Directive { /** * Configures the queries that will be injected into the directive. * + * 配置一些查询,它们将被注入到该指令中。 + * * Content queries are set before the `ngAfterContentInit` callback is called. * View queries are set before the `ngAfterViewInit` callback is called. * + * 内容查询会在调用 `ngAfterContentInit` 回调之前设置好。 + * 试图查询会在调用 `ngAfterViewInit` 回调之前设置好。 + * * @usageNotes * * ### Example * + * ### 范例 + * * The following example shows how queries are defined * and when their results are available in lifecycle hooks: * + * 下面的范例展示了如何定义这些查询以及到生命周期钩子中的哪个步骤才会有结果: + * * ``` * @Component({ * selector: 'someDir', @@ -241,7 +328,11 @@ export interface Directive { * If true, this directive/component will be skipped by the AOT compiler and so will always be * compiled using JIT. * + * 如果为 `true`,则该指令/组件将会被 AOT 编译器忽略,因此永远只会被 JIT 编译。 + * * This exists to support future Ivy work and has no effect currently. + * + * 这个选项是为了支持未来的 Ivy 编译器,目前还没有效果。 */ jit?: true; } @@ -249,6 +340,8 @@ export interface Directive { /** * Directive decorator and metadata. * + * 指令的装饰器和元数据 + * * @Annotation */ export interface Directive { @@ -256,21 +349,46 @@ export interface Directive { * The CSS selector that identifies this directive in a template * and triggers instantiation of the directive. * + * 这个 CSS 选择器用于在模板中标记出该指令,并触发该指令的实例化。 + * * Declare as one of the following: * + * 可使用下列形式之一: + * * - `element-name`: Select by element name. + * + * `element-name`:根据元素名选取。 + * * - `.class`: Select by class name. + * + * `.class`:根据类名选取。 + * * - `[attribute]`: Select by attribute name. + * + * `[attribute]`:根据属性名选取。 + * * - `[attribute=value]`: Select by attribute name and value. + * + * `[attribute=value]`:根据属性名和属性值选取。 + * * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`. + * + * `:not(sub_selector)`:只有当元素不匹配子选择器 `sub_selector` 的时候才选取。 + * * - `selector1, selector2`: Select if either `selector1` or `selector2` matches. * + * `selector1, selector2`:无论 `selector1` 还是 `selector2` 匹配时都选取。 + * * Angular only allows directives to apply on CSS selectors that do not cross * element boundaries. * + * Angular 只允许指令使用那些不跨元素边界的 CSS 选择器。 + * * For the following template HTML, a directive with an `input[type=text]` selector, * would be instantiated only on the `` element. * + * 对于下列模板 HTML,具有 `input[type=text]` 选择器的指令只会在 `` 元素上实例化。 + * * ```html * * @@ -286,10 +404,20 @@ export interface Directive { * When an output property emits an event, an event handler attached * to that event in the template is invoked. * + * 一组可供事件绑定的输出属性。当输出属性发出事件时,就会调用模板中一个附加到该事件的处理器。 + * * Each output property maps a `directiveProperty` to a `bindingProperty`: + * + * 每个输出属性都会把 `directiveProperty` 映射到 `bindingProperty`: + * * - `directiveProperty` specifies the component property that emits events. + * + * `directiveProperty` 指定要发出事件的组件属性。 + * * - `bindingProperty` specifies the HTML attribute the event handler is attached to. * + * `bindingProperty` 指定要附加事件处理器的 HTML 属性。 + * */ outputs?: string[]; @@ -297,23 +425,43 @@ export interface Directive { * Maps class properties to host element bindings for properties, * attributes, and events, using a set of key-value pairs. * + * 使用一组键-值对,把类的属性映射到宿主元素的绑定(Property、Attribute 和事件)。 + * * Angular automatically checks host property bindings during change detection. * If a binding changes, Angular updates the directive's host element. * + * Angular 在变更检测期间会自动检查宿主 Property 绑定。 + * 如果绑定的值发生了变化,Angular 就会更新该指令的宿主元素。 + * * When the key is a property of the host element, the property value is * the propagated to the specified DOM property. * + * 当 key 是宿主元素的 Property 时,这个 Property 值就会传播到指定的 DOM 属性。 + * * When the key is a static attribute in the DOM, the attribute value * is propagated to the specified property in the host element. * + * 当 key 是 DOM 中的静态 Attribute 时,这个 Attribute 值就会传播到宿主元素上指定的 Property 去。 + * * For event handling: + * + * 对于事件处理: + * * - The key is the DOM event that the directive listens to. * To listen to global events, add the target to the event name. * The target can be `window`, `document` or `body`. + * + * 它的 key 就是该指令想要监听的 DOM 事件。 + * 要想监听全局事件,请把要监听的目标添加到事件名的前面。 + * 这个目标可以是 `window`、`document` 或 `body`。 + * * - The value is the statement to execute when the event occurs. If the * statement evalueates to `false`, then `preventDefault` is applied on the DOM * event. A handler method can refer to the `$event` local variable. * + * 它的 value 就是当该事件发生时要执行的语句。如果该语句返回 `false`,那么就会调用这个 DOM 事件的 `preventDefault` 函数。 + * 这个语句中可以引用局部变量 `$event` 来获取事件数据。 + * */ host?: {[key: string]: string}; @@ -321,6 +469,8 @@ export interface Directive { * Configures the [injector](guide/glossary#injector) of this * directive or component with a [token](guide/glossary#di-token) * that maps to a [provider](guide/glossary#provider) of a dependency. + * + * 使用一个 [令牌](guide/glossary#di-token) 配置该指令或组件的 [注入器](guide/glossary#injector),该令牌会映射到一个依赖项的[提供商](guide/glossary#provider)。 */ providers?: Provider[]; @@ -328,21 +478,30 @@ export interface Directive { * The name or names that can be used in the template to assign this directive to a variable. * For multiple names, use a comma-separated string. * + * 一个或多个名字,可以用来在模板中把该指令赋值给一个变量。当有多个名字时,请使用逗号分隔它们。 + * */ exportAs?: string; /** * Configures the queries that will be injected into the directive. * + * 配置将要注入到该指令中的一些查询。 + * * Content queries are set before the `ngAfterContentInit` callback is called. * View queries are set before the `ngAfterViewInit` callback is called. * + * 内容查询会在调用 `ngAfterContentInit` 回调之前设置好。 + * 试图查询会在调用 `ngAfterViewInit` 回调之前设置好。 + * */ queries?: {[key: string]: any}; } /** * Type of the Directive metadata. + * + * 指令元数据的类型。 */ export const Directive: DirectiveDecorator = makeDecorator( 'Directive', (dir: Directive = {}) => dir, undefined, undefined, @@ -350,6 +509,7 @@ export const Directive: DirectiveDecorator = makeDecorator( /** * Component decorator interface + * 组件装饰器的接口 * */ export interface ComponentDecorator { @@ -358,44 +518,68 @@ export interface ComponentDecorator { * metadata that determines how the component should be processed, * instantiated, and used at runtime. * + * 一个装饰器,用于把某个类标记为 Angular 组件,并为它配置一些元数据,以决定该组件在运行期间该如何处理、实例化和使用。 + * * Components are the most basic UI building block of an Angular app. * An Angular app contains a tree of Angular components. * + * 组件是 Angular 应用中最基本的 UI 构造块。Angular 应用中包含一棵组件树。 + * * Angular components are a subset of directives, always associated with a template. * Unlike other directives, only one component can be instantiated per an element in a template. * + * Angular 的组件是指令的一个子集,它总是有一个与之关联的模板。 + * * A component must belong to an NgModule in order for it to be available * to another component or application. To make it a member of an NgModule, * list it in the `declarations` field of the `@NgModule` metadata. * + * 组件必须从属于某个 NgModule 才能被其它组件或应用使用。 + * 要想让它成为某个 NgModule 中的一员,请把它列在 `@NgModule` 元数据的 `declarations` 字段中。 + * * Note that, in addition to these options for configuring a directive, * you can control a component's runtime behavior by implementing * life-cycle hooks. For more information, see the * [Lifecycle Hooks](guide/lifecycle-hooks) guide. * + * 注意,除了这些用来对指令进行配置的选项之外,你还可以通过实现生命周期钩子来控制组件的运行期行为。 + * 要了解更多,参见 [生命周期钩子](guide/lifecycle-hooks) 章。 + * * @usageNotes * * ### Setting component inputs * + * ### 设置组件的输入属性 + * * The following example creates a component with two data-bound properties, * specified by the `inputs` value. * + * 下免得例子创建了一个带有两个数据绑定属性的组件,它是通过 `inputs` 值来指定的。 + * * * * * * ### Setting component outputs * + * ### 设置组件的输出属性 + * * The following example shows two event emitters that emit on an interval. One * emits an output every second, while the other emits every five seconds. * + * 下面的例子展示了两个事件发生器,它们定时发出事件。一个每隔一秒发出一个输出事件,另一个则隔五秒。 + * * {@example core/ts/metadata/directives.ts region='component-output-interval'} * * ### Injecting a class with a view provider * + * ### 使用视图提供商注入一个类 + * * The following simple example injects a class into a component * using the view provider specified in component metadata: * + * 下面的例子示范了如何在组件元数据中使用视图提供商来把一个类注入到组件中: + * * ``` * class Greeter { * greet(name:string) { @@ -432,22 +616,37 @@ export interface ComponentDecorator { (obj: Component): TypeDecorator; /** * See the `@Component` decorator. + * + * 参见 `@Component` 装饰器。 */ new (obj: Component): Component; } /** * Supplies configuration metadata for an Angular component. + * + * 为 Angular 组件提供配置元数据。 */ export interface Component extends Directive { /** * The change-detection strategy to use for this component. * + * 用于当前组件的变更检测策略。 + * * When a component is instantiated, Angular creates a change detector, * which is responsible for propagating the component's bindings. * The strategy is one of: + * + * 当组件实例化之后,Angular 就会创建一个变更检测器,它负责传播组件各个绑定值的变化。 + * 该策略是下列值之一: + * * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand). + * + * `ChangeDetectionStrategy#OnPush` 把策略设置为 `CheckOnce`(按需)。 + * * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`. + * + * `ChangeDetectionStrategy#Default` 把策略设置为 `CheckAlways`。 */ changeDetection?: ChangeDetectionStrategy; @@ -464,6 +663,8 @@ export interface Component extends Directive { * SystemJS exposes the `__moduleName` variable within each module. * In CommonJS, this can be set to `module.id`. * + * 包含该组件的那个模块的 ID。该组件必须能解析模板和样式表中使用的相对 URL。 + * SystemJS 在每个模块中都导出了 `__moduleName` 变量。在 CommonJS 中,它可以设置为 `module.id`。 */ moduleId?: string; @@ -471,6 +672,7 @@ export interface Component extends Directive { * The URL of a template file for an Angular component. If provided, * do not supply an inline template using `template`. * + * 组件模板文件的 URL。如果提供了它,就不要再用 `template` 来提供内联模板了。 */ templateUrl?: string; @@ -478,18 +680,23 @@ export interface Component extends Directive { * An inline template for an Angular component. If provided, * do not supply a template file using `templateUrl`. * + * 组件的内联模板。如果提供了它,就不要再用 `templateUrl` 提供模板了。 */ template?: string; /** * One or more URLs for files containing CSS stylesheets to use * in this component. + * + * 一个或多个 URL,指向包含本组件 CSS 样式表的文件。 */ styleUrls?: string[]; /** * One or more inline CSS stylesheets to use * in this component. + * + * 本组件用到的一个或多个内联 CSS 样式。 */ styles?: string[]; @@ -498,28 +705,47 @@ export interface Component extends Directive { * `state()` and `transition()` definitions. * See the [Animations guide](/guide/animations) and animations API documentation. * + * 一个或多个动画 `trigger()` 调用,包含一些 `state()` 和 `transition()` 定义。 + * 参见[动画](/guide/animations)和相关的 API 文档。 */ animations?: any[]; /** * An encapsulation policy for the template and CSS styles. One of: + * + * 供模板和 CSS 样式使用的样式封装策略。取值为: + * * - `ViewEncapsulation.Native`: Use shadow roots. This works * only if natively available on the platform. + * + * `ViewEncapsulation.Native`:使用 Shadow DOM。它只在原生支持 Shadow DOM 的平台上才能工作。 + * * - `ViewEncapsulation.Emulated`: Use shimmed CSS that * emulates the native behavior. + * + * `ViewEncapsulation.Emulated`:使用垫片(shimmed) CSS 来模拟原生行为。 + * * - `ViewEncapsulation.None`: Use global CSS without any * encapsulation. * + * `ViewEncapsulation.None`:使用全局 CSS,不做任何封装。 + * * If not supplied, the value is taken from `CompilerOptions`. The default compiler option is * `ViewEncapsulation.Emulated`. * + * 如果没有提供,该值就会从 `CompilerOptions` 中获取它。默认的编译器选项是 `ViewEncapsulation.Emulated`。 + * * If the policy is set to `ViewEncapsulation.Emulated` and the component has no `styles` * or `styleUrls` specified, the policy is automatically switched to `ViewEncapsulation.None`. + * + * 如果该策略设置为 `ViewEncapsulation.Emulated`,并且该组件没有指定 `styles` 或 `styleUrls`,就会自动切换到 `ViewEncapsulation.None`。 */ encapsulation?: ViewEncapsulation; /** * Overrides the default encapsulation start and end delimiters (`{{` and `}}`) + * + * 改写默认的插值表达式起止分界符(`{{` 和 `}}`) */ interpolation?: [string, string]; @@ -528,6 +754,8 @@ export interface Component extends Directive { * this component. For each component listed here, * Angular creates a {@link ComponentFactory} and stores it in the * {@link ComponentFactoryResolver}. + * + * 一个组件的集合,它应该和当前组件一起编译。对于这里列出的每个组件,Angular 都会创建一个 {@link ComponentFactory} 并保存进 {@link ComponentFactoryResolver} 中。 */ entryComponents?: Array|any[]>; @@ -536,6 +764,9 @@ export interface Component extends Directive { * from the compiled template. Whitespace characters are those matching the `\s` * character class in JavaScript regular expressions. Default is false, unless * overridden in compiler options. + * + * 为 `true` 则保留,为 `false` 则从编译后的模板中移除可能多余的空白字符。 + * 空白字符就是指那些能在 JavaScript 正则表达式中匹配 `\s` 的字符。默认为 `false`,除非通过编译器选项改写了它。 */ preserveWhitespaces?: boolean; } @@ -543,15 +774,22 @@ export interface Component extends Directive { /** * Component decorator and metadata. * + * 组件装饰器与元数据 + * * @usageNotes * * ### Using animations * + * ### 使用动画 + * * The following snippet shows an animation trigger in a component's * metadata. The trigger is attached to an element in the component's * template, using "@_trigger_name_", and a state expression that is evaluated * at run time to determine whether the animation should start. * + * 下列代码片段展示了组件元数据中的一些动画触发器。 + * 该触发器会附加到组件模板中的某个元素上(使用 "@_trigger_name_"),并在运行期间计算一个状态表达式,以决定该启动哪个动画。 + * * ```typescript * @Component({ * selector: 'animation-cmp', @@ -575,28 +813,54 @@ export interface Component extends Directive { * * ### Preserving whitespace * + * ### 保留空白 + * * Removing whitespace can greatly reduce AOT-generated code size, and speed up view creation. * As of Angular 6, default for `preserveWhitespaces` is false (whitespace is removed). * To change the default setting for all components in your application, set * the `preserveWhitespaces` option of the AOT compiler. * + * 移除空白可以大幅减小 AOT 生成的代码的体积,并能更快速的创建视图。 + * 对于 Angular 6,`preserveWhitespaces` 的默认值是 `false`(也就是说将移除空白)。 + * 如果要修改应用中所有组件的默认设置,请设置 AOT 编译器的 `preserveWhitespaces` 选项。 + * * Current implementation removes whitespace characters as follows: + * + * 当前的实现会按照下列规则移除空白字符: + * * - Trims all whitespaces at the beginning and the end of a template. + * + * 移除模板开头和结尾处的所有空白。 + * * - Removes whitespace-only text nodes. For example, * ` ` becomes * ``. + * + * 移除只有空白字符的文本节点。比如: + * ` ` 会变成 + * ``. + * * - Replaces a series of whitespace characters in text nodes with a single space. * For example, `\n some text\n` becomes ` some text `. + * + * 把文本节点内部的一系列空白字符替换为单个空格。比如`\n some text\n` 会变成 ` some text `。 + * * - Does NOT alter text nodes inside HTML tags such as `
` or `