ngModel does not work with Angular 4 reactive forms
See original GitHub issueYour latest update (4.3.0) uses ngModel to bind data, How do you bind data to your date-time-picker when implementing data entry forms using Angular 4’s reactive forms? Reactive forms do not use ngModel.
I tried using [ngModel]="momentValue" (onChange)="setMoment($event)"
as referenced in your help, however, the Date/Time value in popup was never getting bound to the value in the form. The popup would just default to today’s value.
Is it possible to use date-time-picker with reactive forms approach for Angular 4?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
angular - Two way binding in reactive forms - Stack Overflow
ngModel or Template driven forms and reactive forms( model driven forms ) can be mixed together. for example, it's ...
Read more >How to bind reactive form input data with ngModel in Angular ...
Friends in this post, I am binding my reactive form input data with ngModel. I have also used bootstrap because to make reactive...
Read more >Angular Forms Guide: Template Driven and Reactive Forms
This post is an in-depth comparison between the two different alternatives for building forms in Angular - Template Driven Forms and ...
Read more >FormControlName - Angular
Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in Angular v6 and is scheduled...
Read more >Angular Form Controls and ngModels Don't mix
Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in Angular v6 and is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey Tomschreck,
the last version implements the ControlValueAccessor interface. That means you can use the date-time-picker like any other form component (input, select, etc.). You can now easy use
[formControl]="momentValue"
instead of[ngModel]="momentValue"
.I hope this helps.
@Vorlif @itsmekhanh Try the package version @4.3.2
See if this fixed the issues