diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 3b983196d2..e6892037d4 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -60,7 +60,7 @@ [x] | router/CanActivate | 0.27 [x] | router | 0.26 [ ] | animations/style | 0.25 -[ ] | common/SlicePipe | 0.25 +[x] | common/SlicePipe | 0.25 [ ] | router/Event | 0.25 [ ] | common/JsonPipe | 0.25 [x] | forms/FormArray | 0.25 diff --git a/packages/common/src/pipes/slice_pipe.ts b/packages/common/src/pipes/slice_pipe.ts index af2726382e..4c8347cf41 100644 --- a/packages/common/src/pipes/slice_pipe.ts +++ b/packages/common/src/pipes/slice_pipe.ts @@ -15,27 +15,43 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * * Creates a new `Array` or `String` containing a subset (slice) of the elements. * + * 从一个 `Array` 或 `String` 中创建其元素一个新子集(slice)。 + * * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()` * and `String.prototype.slice()`. * + * 所有行为都基于 JavaScript API `Array.prototype.slice()` 和 `String.prototype.slice()` 的预期行为。 + * * When operating on an `Array`, the returned `Array` is always a copy even when all * the elements are being returned. * + * 当操作 `Array` 时,返回的 `Array` 始终是一个副本 —— 即使返回了所有元素也是一样。 + * * When operating on a blank value, the pipe returns the blank value. * + * 当操作空白值时,该管道也会返回空白值。 + * * ### List Example * + * ### 列表范例 + * * This `ngFor` example: * + * `ngFor` 例子: + * * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'} * * produces the following: * + * 生成下列内容: + * *