Open trotyl opened 5 years ago
Integrate Pipes with render function.
Pipe
render
function pipe(type: Type<any>): (value: any, ...extras: any[]) => never
type
value
extras
import { AsyncPipe, DatePipe } from '@angular/common' import { pipe, Renderable } from 'ng-renderable' const async = pipe(AsyncPipe) const date = pipe(DatePipe) @Component() class MyComponent extends Renderable { @Input() title: Observable<string> @Input() date: Date render() { return ( <p title={ async(this.title) }> { date(this.date, 'fullDate') } </p> ) } }
Integrate
Pipe
s withrender
function.API Design
type
: the pipe class;value
: the value passed to pipe;extras
: additional parameters passed to pipe;Example