Solvedangular Generics do not correctly infer in template pipe usage
✔️Accepted Answer
Other Answers:
Any news? I'm using vscode extension and its basically unusable. A lot of errors everywhere.
I am having same issue with built-in slice
pipe.
For instance:
<div *ngFor="let item of (items | slice : 0 : 5)">
The type of item is lost. item.id
starts giving error:
Identifier 'id' is not defined. 'T' does not contain such a member"
Would love to see a fix or workaround for this. Let us know if we can help. I thought I had made a mistake fixing up my template variable types. I didn't notice it was compiling despite the warnings in VS Code.
It is almost 2 years after this bug is first added and still with Angular 8.2.7 this issue is not fixed. I do understand that TypeScript 3 may have an issue with this, but i also think that the Angular Pipe should have a solution for this. It is not always possible or wanted to do stuff like slining outsite of the template. otherwise i could do some like this.trips = this.trips.slice(this.start,this.end);
I'm submitting a...
Current behavior
Please take a look at the minimal example below:
Angular language service (v5.0.2) gives me an error:
Error:(7, 9) Angular: Identifier 'bar' is not defined. 'R' does not contain such a member
Expected behavior
Should infer the type as TypeScript would.
From angular/vscode-ng-language-service#196