docs(API): 翻译完了 AsyncPipe
This commit is contained in:
parent
78248db322
commit
3fc7bb2ab4
|
@ -41,7 +41,7 @@
|
||||||
[x] | forms/NgForm | 0.50
|
[x] | forms/NgForm | 0.50
|
||||||
[ ] | core/Renderer2 | 0.49
|
[ ] | core/Renderer2 | 0.49
|
||||||
[x] | core/HostListener | 0.47
|
[x] | core/HostListener | 0.47
|
||||||
[ ] | common/AsyncPipe | 0.45
|
[x] | common/AsyncPipe | 0.45
|
||||||
[ ] | core/ViewContainerRef | 0.42
|
[ ] | core/ViewContainerRef | 0.42
|
||||||
[ ] | common/NgTemplateOutlet | 0.42
|
[ ] | common/NgTemplateOutlet | 0.42
|
||||||
[ ] | common/Location | 0.41
|
[ ] | common/Location | 0.41
|
||||||
|
|
|
@ -46,22 +46,32 @@ const _observableStrategy = new ObservableStrategy();
|
||||||
*
|
*
|
||||||
* Unwraps a value from an asynchronous primitive.
|
* Unwraps a value from an asynchronous primitive.
|
||||||
*
|
*
|
||||||
|
* 从一个异步回执中解出一个值。
|
||||||
|
*
|
||||||
* The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
|
* The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
|
||||||
* emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
|
* emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
|
||||||
* changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
|
* changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
|
||||||
* potential memory leaks.
|
* potential memory leaks.
|
||||||
*
|
*
|
||||||
|
* `async` 管道会订阅一个 `Observable` 或 `Promise`,并返回它发出的最近一个值。
|
||||||
|
* 当新值到来时,`async` 管道就会把该组件标记为需要进行变更检测。当组件被销毁时,`async` 管道就会自动取消订阅,以消除潜在的内存泄露问题。
|
||||||
*
|
*
|
||||||
* ## Examples
|
* ## Examples
|
||||||
*
|
*
|
||||||
|
* ## 例子
|
||||||
|
*
|
||||||
* This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
|
* This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
|
||||||
* promise.
|
* promise.
|
||||||
*
|
*
|
||||||
|
* 这个例子把一个 `Promise` 绑定到了视图中。点击 `Resolve` 按钮就会解析此 Promise。
|
||||||
|
*
|
||||||
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
|
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
|
||||||
*
|
*
|
||||||
* It's also possible to use `async` with Observables. The example below binds the `time` Observable
|
* It's also possible to use `async` with Observables. The example below binds the `time` Observable
|
||||||
* to the view. The Observable continuously updates the view with the current time.
|
* to the view. The Observable continuously updates the view with the current time.
|
||||||
*
|
*
|
||||||
|
* 还可以把 `async` 用于 `Observable`。下面的例子就把 `time` 这个 `Observable` 绑定到了视图上。这个 `Observable` 会不断使用当前时间更新视图。
|
||||||
|
*
|
||||||
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
|
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue