angular-cn/public/docs/js/latest/api/pipes/AsyncPipe-class.jade

88 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-04-21 23:34:30 -07:00
2015-04-22 08:06:51 -07:00
p.location-badge.
2015-04-23 08:27:36 -07:00
exported from <a href="/angular2/pipes.html">angular2/pipes</a>
2015-04-21 23:34:30 -07:00
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/async_pipe.js#L29">angular2/src/change_detection/pipes/async_pipe.js (line 29)</a>
:markdown
Implements async bindings to Observable.
# Example
In this example we bind the description observable to the DOM. The async pipe will convert an observable to the
latest value it emitted. It will also request a change detection check when a new value is emitted.
```
@Component({
selector: "task-cmp",
changeDetection: ON_PUSH
})
@View({
inline: "Task Description {{description|async}}"
})
class Task {
description:Observable<string>;
}
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(ref:ChangeDetectorRef)
:markdown
.l-sub-section
h3 onDestroy
pre.prettyprint
code.
onDestroy()
:markdown
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obs)
:markdown
.l-sub-section
h3 transform
pre.prettyprint
code.
transform(obs:Observable)
:markdown