angular-pipes
angular-pipes copied to clipboard
Keep types when using pipes
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
Current behavior
all to any, no types any more
Expected behavior
keep types
Minimal reproduction of the problem with instructions
numbers: number[] = [1, 2, 3, 4, 5]
numbers | where: 1 is an any[] not number[]
What is the motivation / use case for changing the behavior?
~~I'm not sure it's actually possible with Angular to do this. The transform method on the PipeTransform interface doesn't accept generic type information.
https://angular.io/api/core/PipeTransform~~
~~However, if you find a way, feel free to inform me :)~~
It looks like it's actually possible (with some issues: https://github.com/angular/angular/issues/21224), however it would require time to do this for all pipes which I don't have right now. Feel free to start a PR.