From b046dfdb6e8dca3d3ec1af19f1d65422fdc63a5e Mon Sep 17 00:00:00 2001 From: Zhicheng WANG Date: Thu, 6 Jun 2019 21:38:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=E5=90=88=E5=B9=B6=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20fix:=20=E6=9A=82=E6=97=B6=E6=92=A4=E9=94=80?= =?UTF-8?q?=E5=AF=B9=20HttpClient=20=E7=9A=84=E7=BF=BB=E8=AF=91=EF=BC=8C?= =?UTF-8?q?=E5=AE=83=E7=9A=84=E6=94=B9=E5=8A=A8=E5=A4=AA=E5=A4=A7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/http/src/client.ts | 543 ------------------ packages/common/http/src/params.ts | 1 + packages/common/src/location/location.ts | 2 +- packages/core/src/metadata/directives.ts | 4 +- packages/core/src/metadata/ng_module.ts | 2 +- packages/forms/src/model.ts | 9 +- .../src/security/dom_sanitization_service.ts | 12 +- packages/router/src/config.ts | 10 +- packages/router/src/router.ts | 25 +- packages/router/src/router_module.ts | 4 +- 10 files changed, 37 insertions(+), 575 deletions(-) diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index 71db4db8b4..e6712e116c 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -47,8 +47,6 @@ export type HttpObserve = 'body' | 'events' | 'response'; /** * Performs HTTP requests. * - * 执行 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 based on * the signature that is called (mainly the values of `observe` and `responseType`). @@ -97,11 +95,7 @@ export class HttpClient { /** * Sends an `HTTPRequest` and returns a stream of `HTTPEvents`. * - * 发送指定的 `HttpRequest` 并返回一个由 `HTTPEvents` 组成的流。 - * * @return An `Observable` of the response, with the response body as a stream of `HTTPEvents`. - * - * 一个由响应组成的 `Observable`,其响应体是 `HTTPEvents` 组成的流。 */ request(req: HttpRequest): Observable>; @@ -129,15 +123,11 @@ export class HttpClient { * Constructs a request that interprets the body as a blob and returns * the response as a blob. * - * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ request(method: string, url: string, options: { body?: any, @@ -152,15 +142,11 @@ export class HttpClient { * Constructs a request that interprets the body as a text string and * returns a string value. * - * 构造一个请求,这个请求会把 body 解释为文本,并返回它。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ request(method: string, url: string, options: { body?: any, @@ -175,16 +161,12 @@ export class HttpClient { * Constructs a request that interprets the body as an `ArrayBuffer` and returns the * the full event stream. * - * 构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an array of `HTTPEvents` for the * request. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -198,16 +180,12 @@ export class HttpClient { * Constructs a request that interprets the body as a `Blob` and returns * the full event stream. * - * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of of all `HttpEvents` for the request, * with the response body of type `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -221,16 +199,12 @@ export class HttpClient { /** * Constructs a request which interprets the body as a text string and returns the full event stream. * - * 构造一个请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvents` for the reques, * with the response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -244,16 +218,12 @@ export class HttpClient { /** * Constructs a request which interprets the body as a JSON object and returns the full event stream. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvents` for the request, * with the response body of type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -268,16 +238,12 @@ export class HttpClient { /** * Constructs a request which interprets the body as a JSON object and returns the full event stream. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvents` for the request, * with the response body of type `R`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `R` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -293,15 +259,11 @@ export class HttpClient { * Constructs a request which interprets the body as an `ArrayBuffer` * and returns the full `HTTPResponse`. * - * 构造一个请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -315,15 +277,11 @@ export class HttpClient { /** * Constructs a request which interprets the body as a `Blob` and returns the full `HTTPResponse`. * - * 构造一个请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body of type `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -337,15 +295,11 @@ export class HttpClient { /** * Constructs a request which interprets the body as a text stream and returns the full `HTTPResponse`. * - * 构造一个请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the HTTP response, with the response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -359,16 +313,12 @@ export class HttpClient { /** * Constructs a request which interprets the body as a JSON object and returns the full `HTTPResponse`. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HTTPResponse`, * with the response body of type `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -384,15 +334,11 @@ export class HttpClient { * Constructs a request which interprets the body as a JSON object and returns * the full `HTTPResponse` with the response body in the requested type. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HTTPResponse`, with the response body of type `R`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。 */ request(method: string, url: string, options: { body?: any, @@ -408,15 +354,11 @@ export class HttpClient { * Constructs a request which interprets the body as a JSON object and returns the full * `HTTPResponse` as a JSON object. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body of type `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ request(method: string, url: string, options?: { body?: any, @@ -432,15 +374,11 @@ export class HttpClient { * Constructs a request which interprets the body as a JSON object * with the response body of the requested type. * - * 构造一个请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body of type `R`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `R` 型的。 */ request(method: string, url: string, options?: { body?: any, @@ -455,15 +393,11 @@ export class HttpClient { /** * Constructs a request where response type and requested observable are not known statically. * - * 以某种方式构造请求,其响应类型和所请求的 `Observable` 都是无法静态获知的。 - * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the reuested response, wuth body of type `any`. - * - * 所请求的任意 `Observable`,其类型是 `any`。 */ request(method: string, url: string, options?: { body?: any, @@ -480,8 +414,6 @@ export class HttpClient { * fires the request through the chain of registered interceptors and on to the * server. * - * 为一个特定的 HTTP 请求构造一个 `Observable`,当它被订阅时,就触发该请求,经过一系列已注册的拦截器的处理之后,最终发给服务器。 - * * You can pass an `HttpRequest` directly as the only parameter. In this case, * the call returns an observable of the raw `HttpEvent` stream. * @@ -623,14 +555,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` * and returns the response as an `ArrayBuffer`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -645,14 +573,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -666,14 +590,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a text string and returns * a string. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -687,15 +607,11 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HTTPEvents` for the request, * with response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -709,15 +625,11 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a `Blob` * and returns the full event stream. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all the `HTTPEvents` for the request, with the response body as a * `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -731,15 +643,11 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a text string * and returns the full event stream. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HTTPEvents` for the request, with the response * body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -753,15 +661,11 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HTTPEvents` for the request, with response body of * type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -776,15 +680,11 @@ export class HttpClient { * Constructs a `DELETE`request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all the `HTTPEvents` for the request, with a response * body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -799,14 +699,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` and returns * the full `HTTPResponse`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HTTPResponse`, with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -820,14 +716,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a `Blob` and returns the full * `HTTPResponse`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body of type `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -841,14 +733,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a text stream and * returns the full `HTTPResponse`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HTTPResponse`, with the response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -862,20 +750,11 @@ export class HttpClient { * Constructs a `DELETE` request the interprets the body as a JSON object and returns * the full `HTTPResponse`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. - * - * 端点 URL。 - * * @param options The HTTP options to send with the request. * - * 和该请求一起发送的 HTTP 选项。 - * * @return An `Observable` of the `HTTPResponse`, with the response body of type `Object`. * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 - * */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -890,14 +769,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with the response body of the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ delete(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -912,14 +787,10 @@ export class HttpClient { * Constructs a `DELETE` request that interprets the body as a JSON object and * returns the response body as a JSON object. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Object`. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ delete (url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -934,14 +805,10 @@ export class HttpClient { * Constructs a DELETE request that interprets the body as a JSON object and returns * the response in a given type. * - * 构造一个 `DELETE` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with response body in the requested type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ delete(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -957,17 +824,9 @@ export class HttpClient { * `DELETE` request to execute on the server. See the individual overloads for * details on the return type. * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `DELETE` 请求。 - * 关于返回类型的详细信息请参见它的各个重载形式。 - * * @param url The endpoint URL. - * - * 端点 URL。 - * * @param options The HTTP options to send with the request. * - * 和该请求一起发送的 HTTP 选项。 - * */ delete (url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -985,14 +844,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns the response in * an `ArrayBuffer`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1006,14 +861,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a `Blob` * and returns the response as a `Blob`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1027,14 +878,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a text string * and returns the response as a string value. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1048,15 +895,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns * the full event stream. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvents` for the request, with the response * body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1070,14 +913,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a `Blob` and * returns the full event stream. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1091,14 +930,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a text string and returns * the full event stream. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1112,14 +947,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1133,14 +964,10 @@ export class HttpClient { /** * Constructs a `GET` request that interprets the body as a JSON object and returns the full event stream. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with a response body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1155,15 +982,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and * returns the full `HTTPResponse`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1177,15 +1000,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a `Blob` and * returns the full `HTTPResponse`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1199,15 +1018,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a text stream and * returns the full `HTTPResponse`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1221,15 +1036,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a JSON object and * returns the full `HTTPResponse`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, * with the response body of type `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1244,15 +1055,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a JSON object and * returns the full `HTTPResponse`. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HTTPResponse` for the request, * with a response body in the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1267,20 +1074,11 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a JSON object and * returns the response body as a JSON object. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. - * - * 端点 URL。 - * * @param options The HTTP options to send with the request. * - * 和该请求一起发送的 HTTP 选项。 * * @return An `Observable` of the response body as a JSON object. - * - * 一个由 JSON 对象类型的 body 组成的 `Observable` 对象。 - */ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1295,14 +1093,10 @@ export class HttpClient { * Constructs a `GET` request that interprets the body as a JSON object and returns * the response body in a given type. * - * 构造一个 `GET` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse`, with a response body in the requested type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ get(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1317,9 +1111,6 @@ export class HttpClient { * Constructs an observable that, when subscribed, causes the configured * `GET` request to execute on the server. See the individual overloads for * details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `GET` 请求。 - * 关于 `get()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ get(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1337,14 +1128,10 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and * returns the response as an `ArrayBuffer`. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1376,14 +1163,10 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a text string and returns the response * as a string value. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1397,15 +1180,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of tall `HttpEvents` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1419,15 +1198,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a `Blob` and * returns the full event stream. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1441,14 +1216,10 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a text string * and returns the full event stream. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all HttpEvents for the request, with the response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1462,15 +1233,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object * and returns the full HTTP event stream. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HTTPEvents` for the request, with a response body of * type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1485,15 +1252,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the full event stream. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @return An `Observable` of all the `HTTPEvents` for the request * , with a response body in the requested type. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1508,15 +1271,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` * and returns the full HTTP response. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1530,15 +1289,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a `Blob` and returns * the full `HTTPResponse`. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as a blob. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1552,15 +1307,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as text stream * and returns the full `HTTPResponse`. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1574,15 +1325,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the full `HTTPResponse`. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body of type `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1597,15 +1344,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with a responmse body of the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1620,14 +1363,10 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the response body as a JSON object. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a JSON object. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1642,15 +1381,11 @@ export class HttpClient { * Constructs a `HEAD` request that interprets the body as a JSON object and returns * the response in a given type. * - * 构造一个 `HEAD` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HTTPResponse` for the request, * with a response body of the given type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ head(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1667,9 +1402,6 @@ export class HttpClient { * meta information about the resource without transferring the * resource itself. See the individual overloads for * details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `HEAD` 请求。 - * 关于 `head()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ head(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1685,47 +1417,24 @@ export class HttpClient { /** * Constructs a `JSONP` request for the given URL and name of the callback parameter. * - * 使用指定的 URL 和回调函数名构造一个 JSONP 请求。 - * * @param url The resource URL. - * - * 资源 URL。 - * * @param callbackParam The callback function name. * - * 回调函数的名字。 - * * @return An `Observable` of the response object, with response body as an object. - * - * 一个 `Object` 型响应对象组成的 `Observable` 对象 - * */ jsonp(url: string, callbackParam: string): Observable; /** * Constructs a `JSONP` request for the given URL and name of the callback parameter. * - * 使用指定的 URL 和回调函数名构造一个 JSONP 请求。 - * * @param url The resource URL. - * - * 资源 URL。 - * * @param callbackParam The callback function name. * - * 回调函数的名字。 - * * You must install a suitable interceptor, such as one provided by `HttpClientJsonpModule`. * If no such interceptor is reached, * then the `JSONP` request can be rejected by the configured backend. * - * 你必须先安装适当的拦截器,比如 `HttpClientJsonpModule` 所提供的那个。 - * 如果没有这样的拦截器,那么 `JSONP` 可能会被所配置的后端拒绝处理。 - * * @return An `Observable` of the response object, with response body in the requested type. - * - * 一个响应对象的 `Observable`,其中带有请求中所要求的响应体。 - * */ jsonp(url: string, callbackParam: string): Observable; @@ -1759,14 +1468,10 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as an * `ArrayBuffer` and returns the response as an `ArrayBuffer`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1780,14 +1485,10 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1801,14 +1502,10 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a text string and * returns a string value. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1822,15 +1519,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1844,15 +1537,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a `Blob` and * returns the full event stream. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1866,15 +1555,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a text string * and returns the full event stream. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HTTPEvents` for the request, * with the response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1888,15 +1573,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvents` for the request with the response * body of type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1911,15 +1592,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object and * returns the full event stream. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvents` for the request, * with a response body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1934,15 +1611,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer` * and returns the full HTTP response. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1956,15 +1629,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a `Blob` * and returns the full `HTTPResponse`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -1978,15 +1647,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as text stream * and returns the full `HTTPResponse`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2000,15 +1665,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2023,15 +1684,11 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object and * returns the full `HTTPResponse`. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2046,14 +1703,10 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the response * body as a JSON object. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a JSON object. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2068,14 +1721,10 @@ export class HttpClient { * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the response * in a given type. * - * 构造一个 `OPTIONS` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HTTPResponse`, with a response body of the given type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ options(url: string, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2092,9 +1741,6 @@ export class HttpClient { * to determine the supported HTTP methods and other capabilites of an endpoint, * without implying a resource action. See the individual overloads for * details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `OPTIONS` 请求。 - * 关于 `options()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ options(url: string, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2111,15 +1757,11 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and returns * the response as an `ArrayBuffer`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2133,15 +1775,11 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response * as a `Blob`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2155,15 +1793,11 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as as a text string and * returns the response as a string value. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with a response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2177,16 +1811,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and * returns the the full event stream. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HTTPevents` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ patch(url: string, body: any|null, options: { @@ -2201,16 +1831,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a `Blob` * and returns the full event stream. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HTTPevents` for the request, with the * response body as `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2224,16 +1850,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a text string and * returns the full event stream. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HTTPevents`for the request, with a * response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2247,16 +1869,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HTTPevents` for the request, * with a response body of type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2271,16 +1889,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full event stream. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HTTPevents` for the request, * with a response body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2295,16 +1909,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` * and returns the full `HTTPResponse`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2318,16 +1928,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the full * `HTTPResponse`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2341,16 +1947,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a text stream and returns the * full `HTTPResponse`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2364,16 +1966,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2388,16 +1986,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the given type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2412,15 +2006,11 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object and * returns the response body as a JSON object. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a JSON object. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2435,16 +2025,12 @@ export class HttpClient { * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the response in a given type. * - * 构造一个 `PATCH` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the given type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ patch(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2459,9 +2045,6 @@ export class HttpClient { * Constructs an observable that, when subscribed, causes the configured * `PATCH` request to execute on the server. See the individual overloads for * details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PATCH` 请求。 - * 关于 `patch()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ patch(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2478,15 +2061,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as an as an `ArrayBuffer` and returns * an `ArrayBuffer`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2500,15 +2079,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a `Blob` and returns the * response as a `Blob`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2522,15 +2097,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a text string and * returns the response as a string value. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with a response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2544,16 +2115,12 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and * returns the full event stream. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2567,15 +2134,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a `Blob` * and returns the response in an observable of the full event stream. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, with the response body as `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2588,16 +2151,12 @@ export class HttpClient { /** * Constructs a `POST` request that interprets the body as a text string and returns the full event stream. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with a response body of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2610,16 +2169,12 @@ export class HttpClient { /** * Constructs a POST request that interprets the body as a JSON object and returns the full event stream. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with a response body of type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2633,16 +2188,12 @@ export class HttpClient { /** * Constructs a POST request that interprets the body as a JSON object and returns the full event stream. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with a response body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2657,15 +2208,11 @@ export class HttpClient { * Constructs a POST request that interprets the body as an `ArrayBuffer` * and returns the full `HTTPresponse`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2679,16 +2226,12 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a `Blob` and returns the full * `HTTPResponse`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2702,16 +2245,12 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a text stream and returns * the full `HTTPResponse`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, * with a response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2725,16 +2264,12 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a JSON object * and returns the full `HTTPResponse`. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body of type * `Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2750,15 +2285,11 @@ export class HttpClient { * `HTTPResponse`. * * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body in the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2773,15 +2304,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a * JSON object and returns the response body as a JSON object. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a JSON object. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2796,15 +2323,11 @@ export class HttpClient { * Constructs a `POST` request that interprets the body as a JSON object * and returns an observable of the response. * - * 构造一个 `POST` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body in the requested type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ post(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2820,9 +2343,6 @@ export class HttpClient { * `POST` request to execute on the server. The server responds with the location of * the replaced resource. See the individual overloads for * details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `POST` 请求。 - * 关于 `post()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ post(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2839,15 +2359,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the * response as an `ArrayBuffer`. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. - * - * 一个由 `ArrayBuffer` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2861,15 +2377,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a `Blob`. - * - * 一个由 `Blob` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2883,15 +2395,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a text string and * returns the response as a string value. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回它。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with a response body of type string. - * - * 一个由 `string` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2905,16 +2413,12 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and * returns the full event stream. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as an `ArrayBuffer`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `ArrayBuffer` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2927,16 +2431,12 @@ export class HttpClient { /** * Constructs a `PUT` request that interprets the body as a `Blob` and returns the full event stream. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Blob` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2949,16 +2449,12 @@ export class HttpClient { /** * Constructs a `PUT` request that interprets the body as a text string and returns the full event stream. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all HttpEvents for the request, with a response body * of type string. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `string` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2971,16 +2467,12 @@ export class HttpClient { /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the full event stream. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, with a response body of * type `Object`. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `Object` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -2995,16 +2487,12 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a JSON object and returns the * full event stream. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的事件流。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvents` for the request, * with a response body in the requested type. - * - * 一个由该请求的所有 `HttpEvents` 组成的 `Observable` 对象,事件的 body 是 `T` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3015,15 +2503,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as an * `ArrayBuffer` and returns an observable of the full HTTP response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `ArrayBuffer` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with the response body as an `ArrayBuffer`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `ArrayBuffer` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3037,16 +2521,12 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a `Blob` and returns the * full HTTP response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 `Blob` ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, * with the response body as a `Blob`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Blob` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3060,15 +2540,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a text stream and returns the * full HTTP response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为文本,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body of type string. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `string` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3081,16 +2557,12 @@ export class HttpClient { /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the full HTTP response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body * of type 'Object`. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `Object` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3104,16 +2576,12 @@ export class HttpClient { /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the full HTTP response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回完整的响应体。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, * with a response body in the requested type. - * - * 一个由该请求的 `HttpResponse` 组成的 `Observable` 对象,其 body 是 `T` 型的。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3128,15 +2596,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a JSON object and returns the response * body as a JSON object. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a JSON object. - * - * 一个由 `Object` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3151,15 +2615,11 @@ export class HttpClient { * Constructs a `PUT` request that interprets the body as a JSON object * and returns an observable of the response. * - * 构造一个 `PUT` 请求,这个请求会把 body 解释为 JSON ,并返回它。 - * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HTTPResponse` for the request, with a response body in the requested type. - * - * 一个由 `T` 型的 body 组成的 `Observable` 对象。 */ put(url: string, body: any|null, options?: { headers?: HttpHeaders | {[header: string]: string | string[]}, @@ -3175,9 +2635,6 @@ export class HttpClient { * `PUT` request to execute on the server. The `PUT` method replaces an existing resource * with a new set of values. * See the individual overloads for details on the return type. - * - * 构造一个 `Observable`,当订阅它时,将导致服务器执行一个配置好的 `PUT` 请求。 - * 关于 `put()` 返回类型的详细信息取决于所提供的选项,参见它的各个重载形式。 */ put(url: string, body: any|null, options: { headers?: HttpHeaders | {[header: string]: string | string[]}, diff --git a/packages/common/http/src/params.ts b/packages/common/http/src/params.ts index cf7195f4a7..8c9960fe1d 100755 --- a/packages/common/http/src/params.ts +++ b/packages/common/http/src/params.ts @@ -32,6 +32,7 @@ export interface HttpParameterCodec { * Use the `HttpParameterCodec` class to encode and decode the query-string values. * * 一个 `HttpParameterCodec`,它使用 `encodeURIComponent` 和 `decodeURIComponent` 来序列化和解析 URL 参数的 key 和 value。 + * 如果你传入未编码的查询参数,那么接收端可能会对这些参数进行错误解析。请使用 `HttpParameterCodec` 类对查询字符串的值进行编码和解码。 * * @publicApi */ diff --git a/packages/common/src/location/location.ts b/packages/common/src/location/location.ts index ff3a6ae263..f23ee58062 100644 --- a/packages/common/src/location/location.ts +++ b/packages/common/src/location/location.ts @@ -145,7 +145,7 @@ export class Location { * Given a string representing a URL, returns the URL path after stripping the * trailing slashes. * - * 给出一个字符串形式的 URL,返回一个标准化的 URL 路径,但不包括首尾的斜杠。 + * 给出一个字符串形式的 URL,返回一个去掉末尾斜杠之后的 URL 路径。 * * @param url String representing a URL. * diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index 1ec441abfd..02570ada4f 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -22,6 +22,7 @@ import {ViewEncapsulation} from './view'; * Type of the Directive decorator / constructor function. * * 指令装饰器的类型和构造函数。 + * * @publicApi */ export interface DirectiveDecorator { @@ -780,7 +781,6 @@ export interface PipeDecorator { * to a template. To make it a member of an NgModule, * list it in the `declarations` field of the `NgModule` metadata. * - * 声明一个可复用的 pipe 函数,并提供配置元数据。 */ (obj: Pipe): TypeDecorator; @@ -930,7 +930,7 @@ export interface OutputDecorator { * The DOM property bound to the output property is automatically updated during change detection. * * 一个装饰器,用于把一个类字段标记为输出属性,并提供配置元数据。 - * 声明一个可绑定的输出属性,Angular 在变更检测期间会自动更新它。 + * 凡是绑定到输出属性上的 DOM 属性,Angular 在变更检测期间都会自动进行更新。 * * @usageNotes * diff --git a/packages/core/src/metadata/ng_module.ts b/packages/core/src/metadata/ng_module.ts index 481987768b..d2d6ad56e8 100644 --- a/packages/core/src/metadata/ng_module.ts +++ b/packages/core/src/metadata/ng_module.ts @@ -57,7 +57,7 @@ export type ɵɵNgModuleDefWithMeta = NgModul * never create the object directly since the shape of this object * can change between versions. * - * 注意:总是使用 `defineNgModule` 函数来创建该对象,永远不要直接创建它,因为该对象的结构在不同版本间可能会不一样。 + * 注意:总是使用 `ɵɵdefineNgModule` 函数来创建该对象,永远不要直接创建它,因为该对象的结构在不同版本间可能会不一样。 */ export interface NgModuleDef { /** Token representing the module. Used by DI. diff --git a/packages/forms/src/model.ts b/packages/forms/src/model.ts index b12f599e60..f19452468d 100644 --- a/packages/forms/src/model.ts +++ b/packages/forms/src/model.ts @@ -198,10 +198,13 @@ export abstract class AbstractControl { * * * For an enabled `FormGroup`, the values of enabled controls as an object * with a key-value pair for each member of the group. + * + * 对于启用状态的 `FormGroup`,它是由组中的每个已启用的成员控件的名称和值组成的对象。 + * * * For a disabled `FormGroup`, the values of all controls as an object * with a key-value pair for each member of the group. * - * 对于 `FormGroup`,它是由组中的每个已启用的成员控件的名称和值组成的对象。 + * 对于禁用状态的 `FormGroup`,它是由组中的所有成员控件的名称和值组成的对象。 * * * For a `FormArray`, the values of enabled controls as an array. * @@ -1874,7 +1877,7 @@ export class FormGroup extends AbstractControl { * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * true. * - * `onlySelf`::如果为 `true`,则每个变更仅仅影响当前控件,而不会影响父控件。默认为 `false`。 + * `onlySelf`:如果为 `true`,则每个变更仅仅影响当前控件,而不会影响父控件。默认为 `false`。 * * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` @@ -2177,7 +2180,7 @@ export class FormGroup extends AbstractControl { * the `FormArray` directly, as that result in strange and unexpected behavior such * as broken change detection. * - * 要改变数组中的控件列表,可以使用 `FormArray` 本身的 `push`、`insert` 或 `removeAt` 方法。这些方法能确保表单数组正确的跟踪这些子控件。 + * 要改变数组中的控件列表,可以使用 `FormArray` 本身的 `push`、`insert`、`removeAt` 或 `clear` 方法。这些方法能确保表单数组正确的跟踪这些子控件。 * 不要直接修改实例化 `FormArray` 时传入的那个 `AbstractControl` 数组,否则会导致奇怪的、非预期的行为,比如破坏变更检测机制。 * * @publicApi diff --git a/packages/platform-browser/src/security/dom_sanitization_service.ts b/packages/platform-browser/src/security/dom_sanitization_service.ts index ee5cd5ed0f..9d2d02bb72 100644 --- a/packages/platform-browser/src/security/dom_sanitization_service.ts +++ b/packages/platform-browser/src/security/dom_sanitization_service.ts @@ -17,7 +17,7 @@ export {SecurityContext}; /** * Marker interface for a value that's safe to use in a particular context. * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全的用在特定的上下文中。 */ export interface SafeValue {} @@ -25,7 +25,7 @@ export interface SafeValue {} /** * Marker interface for a value that's safe to use as HTML. * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全地用在 HTML 上下文中。 */ export interface SafeHtml extends SafeValue {} @@ -33,7 +33,7 @@ export interface SafeHtml extends SafeValue {} /** * Marker interface for a value that's safe to use as style (CSS). * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全地用在样式(CSS)上下文中。 */ export interface SafeStyle extends SafeValue {} @@ -41,7 +41,7 @@ export interface SafeStyle extends SafeValue {} /** * Marker interface for a value that's safe to use as JavaScript. * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全地用在 JavaScript 上下文中。 */ export interface SafeScript extends SafeValue {} @@ -49,7 +49,7 @@ export interface SafeScript extends SafeValue {} /** * Marker interface for a value that's safe to use as a URL linking to a document. * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全地用作 URL 链接到一个文档。 */ export interface SafeUrl extends SafeValue {} @@ -57,7 +57,7 @@ export interface SafeUrl extends SafeValue {} /** * Marker interface for a value that's safe to use as a URL to load executable code from. * - * + * @publicApi * 一个标记性接口,用于表示一个值可以安全地用作 URL 以加载可执行代码。 */ export interface SafeResourceUrl extends SafeValue {} diff --git a/packages/router/src/config.ts b/packages/router/src/config.ts index 84a47649c4..a14aebe07b 100644 --- a/packages/router/src/config.ts +++ b/packages/router/src/config.ts @@ -53,7 +53,6 @@ export type UrlMatchResult = { * is not expressive enough. * * 一个用于匹配路由和 URL 的函数。 - * * 当 `path` 和 `pathMatch` 的组合不足以表达时,可以为 `Route.matcher` 实现一个自定义的 URL 匹配器。 * * @param segments An array of URL segments. @@ -279,10 +278,12 @@ export type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParam * Empty-path route configurations can be used to instantiate components that do not 'consume' * any URL segments. * + * 空路径路由可用来实例化一些不"消费"任何 url 区段的组件。 + * * In the following configuration, when navigating to * `/team/11`, the router instantiates the 'AllUsers' component. * - * 空路径路由可用来实例化一些不"消费"任何 url 区段的组件。来看下列配置: + * 在下列配置中,当导航到 `/team/11` 时,路由器会实例化 'AllUsers' 组件。 * * ``` * [{ @@ -304,8 +305,6 @@ export type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParam * * Note that an empty path route inherits its parent's parameters and data. * - * 空路径路由还可以有子路由。 - * * ``` * [{ * path: 'team/:id', @@ -411,9 +410,6 @@ export type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParam * It then extracts the set of routes defined in that NgModule, * and transparently adds those routes to the main configuration. * - * 惰性加载可以通过把应用拆分成多个发布包,并按需加载它们,来加速应用的启动时间。 - * 路由器的设计让惰性加载非常简易。只要用 `loadChildren` 属性代替 `children` 属性就可以了,例如: - * * ``` * [{ * path: 'team/:id', diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index f6151bd1f8..e85be8d499 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -38,7 +38,7 @@ import {isUrlTree} from './utils/type_guards'; * * Options that modify the navigation strategy. * - * 表示在导航时用到的额外选项。 + * 用于修订导航策略的额外选项。 * @publicApi */ export interface NavigationExtras { @@ -307,7 +307,7 @@ function defaultRouterHook(snapshot: RouterStateSnapshot, runExtras: { * * An NgModule that provides navigation and URL manipulation capabilities. * - * 提供导航和操纵 URL 的能力。 + * 一个提供导航和操纵 URL 能力的 NgModule。 * * @see `Route`. * @see [Routing and Navigation Guide](guide/router). @@ -368,7 +368,7 @@ export class Router { * True if at least one navigation event has occurred, * false otherwise. * - * 表示是否发生过至少一次导航。 + * 如果为 True 则表示是否发生过至少一次导航,反之为 False。 */ navigated: boolean = false; private lastSuccessfulId: number = -1; @@ -399,12 +399,17 @@ export class Router { /** * How to handle a navigation request to the current URL. One of: + * + * 定义当路由器收到一个导航到当前 URL 的请求时应该怎么做。可取下列值之一: + * * - `'ignore'` : The router ignores the request. + * + * `'ignore'`:路由器会忽略此请求。 + * * - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature. * - * 定义当路由器收到一个导航到当前 URL 的请求时应该怎么做。 - * 默认情况下,路由器将会忽略这次导航。但这样会阻止类似于 "刷新" 按钮的特性。 - * 使用该选项可以配置导航到当前 URL 时的行为。默认值为 'ignore'。 + * `'reload'`:路由器会重新加载当前 URL。用来实现"刷新"功能。 + * */ onSameUrlNavigation: 'reload'|'ignore' = 'ignore'; @@ -412,17 +417,17 @@ export class Router { * How to merge parameters, data, and resolved data from parent to child * routes. One of: * - * 定义路由器如何从父路由向子路由合并参数、数据。可用选项为: + * 如何从父路由向子路由合并参数、数据和解析到的数据。可取下列值之一: * * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data * for path-less or component-less routes. * - * `'emptyOnly'`,默认值,只从无路径或无组件的路由继承父级参数。 + * `'emptyOnly'`:让无路径或无组件的路由继承父级的参数、数据和解析到的数据。 * * - `'always'` : Inherit parent parameters, data, and resolved data * for all child routes. * - * `'always'`,允许无条件地继承父级参数。 + * `'always'`:让所有子路由都继承父级的参数、数据和解析到的数据。 * */ paramsInheritanceStrategy: 'emptyOnly'|'always' = 'emptyOnly'; @@ -1019,7 +1024,7 @@ export class Router { /** * Navigate based on the provided URL, which must be absolute. * - * 基于所提供的 url 进行导航。这种导航永远使用绝对路径。 + * 基于所提供的 URL 进行导航,必须使用绝对路径。 * * @param url An absolute URL. The function does not apply any delta to the current URL. * diff --git a/packages/router/src/router_module.ts b/packages/router/src/router_module.ts index fa924f61fe..22ec2cac0a 100644 --- a/packages/router/src/router_module.ts +++ b/packages/router/src/router_module.ts @@ -465,7 +465,7 @@ export interface ExtraOptions { * You can implement custom scroll restoration behavior by adapting the enabled behavior as * follows: * - * 你可以通过如下方式来适配启用时的行为,来自定义恢复滚动位置的策略。 + * 你可以通过如下方式来适配启用时的行为,来自定义恢复滚动位置的策略: * * ```typescript * class AppModule { @@ -619,7 +619,7 @@ export interface ExtraOptions { * In other words, you're required to use `../` rather than `./`. This is currently the default * behavior. Setting this option to `corrected` enables the fix. * - * 换句话说,要使用 `../` 而不是 `./`。目前 v6 版本的默认值是 `legacy`,到 v7 就会移除该选项,以纠正此行为。 + * 换句话说,要使用 `../` 而不是 `./`。它是当前版本的默认行为。把该选项设置为 `corrected` 可以启用这项修正。 */ relativeLinkResolution?: 'legacy'|'corrected'; }