45 lines
814 B
Plaintext
45 lines
814 B
Plaintext
|
|
p.location-badge.
|
|
exported from <a href='../change_detection'>angular2/change_detection</a>
|
|
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.34/modules/angular2/src/change_detection/pipe_transform.ts#L16-L39">angular2/src/change_detection/pipe_transform.ts (line 16)</a>
|
|
|
|
:markdown
|
|
An interface that stateful pipes should implement.
|
|
|
|
#Example
|
|
|
|
```
|
|
class StatefulPipe implements PipeTransform, PipeOnDestroy {
|
|
connection;
|
|
|
|
onDestroy() {
|
|
this.connection.release();
|
|
}
|
|
|
|
transform(value, args = []) {
|
|
this.connection = createConnection();
|
|
// ...
|
|
return someValue;
|
|
}
|
|
}
|
|
```
|
|
|
|
|
|
.l-main-section
|
|
h2 Members
|
|
.l-sub-section
|
|
h3 onDestroy
|
|
|
|
|
|
pre.prettyprint
|
|
code.
|
|
onDestroy()
|
|
|
|
:markdown
|
|
|
|
|
|
|
|
|
|
|
|
|