Repository navigation
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerregressionIndicates than the issue relates to something that worked in a previous versionstate: has PR
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler
Is this a regression?
This is introduced by Ivy.
Description
A component with a template looking like:
<div *ngFor="let user of users | slice: 0:2 as total">
{{ total.length }}: {{ user.name }}
</div>ng build --prod with fullTemplateTypeCheck: true throws, as it thinks length is not a property of total.
🔬 Minimal Reproduction
🔥 Exception or Error
ERROR in src/app/app.component.html:2:6 - error TS2339: Property 'length' does not exist on type 'NgIterable'.
Property 'length' does not exist on type 'Iterable'.
2 {{ total.length }}: {{ user.name }}
~~~~~~~~~~~~~
src/app/app.component.ts:5:16
5 templateUrl: './app.component.html',
~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.
🌍 Your Environment
Angular Version:
Angular CLI: 9.0.0-rc.0
Node: 12.12.0
OS: darwin x64
Angular: 9.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.0
@angular-devkit/build-angular 0.900.0-rc.0
@angular-devkit/build-optimizer 0.900.0-rc.0
@angular-devkit/build-webpack 0.900.0-rc.0
@angular-devkit/core 9.0.0-rc.0
@angular-devkit/schematics 9.0.0-rc.0
@ngtools/webpack 9.0.0-rc.0
@schematics/angular 9.0.0-rc.0
@schematics/update 0.900.0-rc.0
rxjs 6.5.3
typescript 3.6.4
webpack 4.41.2
Anything else relevant?
This is using ng and CLI 9.0.0-rc.0 and fTTC, but not using strictTemplates.
Reacted by Sylvain Dumont and Максим Иванов
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerregressionIndicates than the issue relates to something that worked in a previous versionstate: has PR
Activity
fix(ivy): don't infer template context types when in full mode (#33537)
cexbrayat commentedon Nov 21, 2019
@alxhub I'm still encoutering the issue using
rc.3now withstrictTemplates: true.I updated the repro https://github.com/cexbrayat/ng-iterable
JoostK commentedon Dec 3, 2019
Closing as fixed in #33997.
angular-automatic-lock-bot commentedon Jan 3, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.