question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

angular 9 / Ivy => async 'as' leads to error

See original GitHub issue

🐞 bug report

Affected Package

https://github.com/mpalourdio/ng2

Is this a regression?

Yes, the previous version in which this bug was not present is angular8@latest.

Description

<div id="app" *ngIf="(applicationsList$ | async) as applicationsList">
    <app-search-filter [(applicationsList)]="applicationsList"></app-search-filter>
</div>

yarn start

Error : Property 'applicationsList' does not exist on type 'ChildComponent'. Did you mean 'applicationsList$'?

Disabling Ivy leads to

ERROR in Cannot assign value "$event" to template variable "applicationsList". Template variables are read-only.

🔬 Minimal Reproduction

🔥 Exception or Error


 Property 'applicationsList' does not exist on type 'ChildComponent'. Did you mean 'applicationsList$'?

Disabling Ivy leads to

ERROR in Cannot assign value "$event" to template variable "applicationsList". Template variables are read-only.

🌍 Your Environment

Angular Version:


Angular CLI: 9.0.0-rc.6
Node: 12.13.0
OS: linux x64

Angular: 9.0.0-rc.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.6
@angular-devkit/build-angular     0.900.0-rc.6
@angular-devkit/build-optimizer   0.900.0-rc.6
@angular-devkit/build-webpack     0.900.0-rc.6
@angular-devkit/core              9.0.0-rc.6
@angular-devkit/schematics        9.0.0-rc.6
@ngtools/webpack                  9.0.0-rc.6
@schematics/angular               9.0.0-rc.6
@schematics/update                0.900.0-rc.6
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.2


EDIT (by gkalpak)

Adding the conclusions from https://github.com/angular/angular/issues/34405#issuecomment-566134215 (after the discussion below) here for visibility:

The issue is that this breaking change is not (clearly) documented, so let’s keep this open to track that 😃

Action items:

  • Figure out what the breaking change is exactly (incl. how template variables created via as are different from other template variables).
  • Document that.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
Gztabo21commented, May 21, 2020

hello in my case my mistake was because I had this like this:

<mat-option *ngFor="let terminal of terminals" [(value)]="terminal">{{terminal.Name}}</mat-option>

What I did to solve was to change the value as follows:

<mat-option *ngFor="let terminal of terminals" value="{{terminal}}">{{terminal.Name}}</mat-option>

hola en mi caso mi error era por que tenia esto asi :

<mat-option *ngFor="let terminal of terminals"  [(value)]="terminal">{{terminal.Name}}</mat-option>

lo que hice para solventar fue cambiar el value a la siguiente manera:

<mat-option *ngFor="let terminal of terminals"  value="{{terminal}}">{{terminal.Name}}</mat-option>
3reactions
JoostKcommented, Dec 14, 2019

The error in Ivy was incorrect, this has been resolved in #34339 (which just missed the rc.6 release).

Other than that: what @gkalpak said 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix: Error: Angular structure loaded both synchronously ...
I had three time the same error,. 1 : library wrong import. First, it was because I was creating a library, and one...
Read more >
Angular 9's Best Hidden Feature: Strict Template ... - Auth0
Find and report more errors than ever with Angular 9's Ivy compiler, strict template checking.
Read more >
Creating libraries - Angular
This page provides a conceptual overview of how to create and publish new libraries to extend Angular functionality. If you find that you...
Read more >
Asynchronous Modules and Components in Angular Ivy
Ivy also has the ability to load modules asynchronously due to the fact that modules are no longer compiled into separate NgModuleDefinition and...
Read more >
The Last Guide For Angular Change Detection You'll Ever Need
the input reference has changed · the component or one of its children triggers an event handler · change detection is triggered manually...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found