Angular FormControlName vs NgModel Binding

Discussão em 'Angular' iniciado por Graham, Dezembro 9, 2024.

  1. Graham

    Graham Guest

    I have a general question using Angular's FormgroupName or NgModel. The Docs I am reading say NgModel was deprecated in Version 6, but it is still available in 17/18, today's current version. The beauty of NgModel is that I am getting instant binding back to my data model, but using the FormgroupName requires me to do manually update like this:

    this.account.company = this.profileForm.controls["company"].value;


    Is there a way to bind the fields of a FormGroup like we do with ngModel, or is updating each field manually the norm?

    Thanks

    Continue reading...

Compartilhe esta Página