Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Keep types when using pipes #94

Open
Diluka opened this issue Aug 29, 2019 · 1 comment
Open

Keep types when using pipes #94

Diluka opened this issue Aug 29, 2019 · 1 comment

Comments

@Diluka
Copy link

Diluka commented Aug 29, 2019

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?

@fknop
Copy link
Owner

fknop commented Aug 29, 2019

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: angular/angular#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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants