I wrote my own filter pipe as it disappeared in angular2:
import {Pipe, PipeTransform} from \'angular2/core\';
@Pipe({
name: \'myFilter\'
})
export class
I don't know what you exactly want to do with the size and the Günter's solution can fit your needs.
That said, you can inject the component instance into your pipe and set directly the length into a property of this component.
@Pipe({
name: 'dump'
})
export class DumpPipe {
constructor(@Inject(forwardRef(() => AppComponent)) app:AppComponent) {
this.app = app;
}
transform(array: Array, args: string): Array {
(...)
this.app.filteredItemLength = array.length;
return array;
}
}
@Component({
(...)
})
export class AppComponent {
(...)
}
See this answer:
Hope it helps you, Thierry