You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h1>Todo List</h1><ul><li*ngFor="let todo of todoService.todo$ | async">
{{ todo.title }} <!-- Here I SHOULD get type hints (infer todo variable as type Todo instead of any) --></li></ul>
Logs
N/A
Screenshots
Additional context
If I convert the ngFor expression like this the typing is correct (converting iterable to array):
<li*ngFor="let todo of (todoService.todo$ | async)?.toArray()"><!-- ... --></li>
Zorgatone
changed the title
*ngFor item gets any type if the iterable is not an array
using asyncPipe *ngFor item gets any type if the iterable is not an array
Oct 18, 2020
This is a known issue (angular/angular#21224) and is fixed by the Ivy language service, which will be beta released in Angular 11 (#335 (comment)). As such, I am closing this report.
Describe the bug
I'm iterating over a Immutable.js list, but the item of the list in the html template is not giving type hints (it's inferred as any type)
To Reproduce
This is my template:
Todo class:
Todo Service:
Expected behavior
Logs
N/A
Screenshots
Additional context
If I convert the ngFor expression like this the typing is correct (converting iterable to array):
I'm using vscode-insiders
Version: 1.51.0-insider
Commit: 89c002ab02f87102d91efc83c191ef1174756c6a
Date: 2020-10-15T23:12:18.967Z (2 days ago)
Electron: 9.3.2
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0
And using Angular Language Service vscode extension version v0.1001.0
The text was updated successfully, but these errors were encountered: