ng-vdom
ng-vdom copied to clipboard
Feature: pipe support in render function
Integrate Pipes with render function.
API Design
function pipe(type: Type<any>): (value: any, ...extras: any[]) => never
type: the pipe class;value: the value passed to pipe;extras: additional parameters passed to pipe;
Example
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>
)
}
}