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/forms ngModel bug

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/forms

Is this a regression?

@angular/forms 9, 10, 11 have this issue. I didn't check another versions of @angular/forms

Description

Properties order: [(ngModel)]=β€œtest” (ngModelChange)=β€œtestChange()” emits right value

Properties order: (ngModelChange)=β€œtestChange()” [(ngModel)]=β€œtest” emits WRONG (previous) value

2020-11-14_135717

πŸ”¬ Minimal Reproduction

https://stackblitz.com/edit/angular-ngmodel-bug

πŸ”₯ Exception or Error




No exeptions

🌍 Your Environment

Angular Version:




@angular/forms 9.0.0
@angular/forms 10.0.0
@angular/forms 11.0.0

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Pashozatorcommented, Nov 14, 2020

@DbrmnPhrh why there should be any error or warning?

1reaction
DbrmnPhrhcommented, Nov 14, 2020

@DbrmnPhrh put [(ngModel)]="test" before (ngModelChange)="testChange()" it works fine. in your case you are executing testChange() before test gets latest value.

It is not obvious and there are no error or warning in the console(

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bind to 'ngModel' since it isn't a known property of 'input'
I'm just staring Angular and saw this error when doing the Tour of Heroes tutorial. Sure enough, they now call this out in...
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'input'
To fix Can't bind to 'ngModel' since it isn't a known property of 'input' error in Angular we have to import FormsModule in...
Read more >
NgModel - Angular
Creates a FormControl instance from a domain model and binds it to a form control element. ... Tracks the configuration options for this...
Read more >
Angular Forms Guide: Template Driven and Reactive Forms
We will go through the following topics: Template Driven Forms (similar to AngularJs ng-model); The ngModel, ngForm and ngSubmit directivesΒ ...
Read more >
Angular error Can't bind to 'ngModel' since it isn't a ... - YouTube
MUMBAI. Angular error Can't bind to ' ngModel ' since it isn't a known property of input. 16K views 2 years ago. Questpond....
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