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

77 lines
995 B
Plaintext

p.
<span class="location-badge">exported from <a href="/angular2/pipes">angular2/pipes</a></span>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/pipe.js#L32">angular2/src/change_detection/pipes/pipe.js (line 32)</a>
:markdown
An interface for extending the list of pipes known to Angular.
If you are writing a custom [Pipe], you must extend this interface.
#Example
```
class DoublePipe extends Pipe {
supports(obj) {
return true;
}
transform(value) {
return `${value}${value}`;
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3 onDestroy
pre.prettyprint
code.
()
:markdown
.l-sub-section
h3 supports
pre.prettyprint
code.
(obj)
:markdown
.l-sub-section
h3 transform
pre.prettyprint
code.
(value:any)
:markdown