Open puddlejumper26 opened 4 years ago
inside this demo, if we set
updateProfile() { this.profileForm.patchValue({ <==== firstName: 'dddddd', lastName: '3333', address: { street: '123 Drew Street', city:'Mmmm' } }); }
than the browser would be like this
if we set like this
updateProfile() { this.profileForm.setValue({ firstName: 'dddddd', lastName: '3333', address: { street: '123 Drew Street', city:'Mmmm' } }); }
Notice above the input are empty, and the Error is : Must supply a value for form control with name: ***.
Must supply a value for form control with name: ***.
[1] https://angular.io/guide/reactive-forms#patching-the-model-value
Demo
inside this demo, if we set
than the browser would be like this![image](https://user-images.githubusercontent.com/40550117/74018080-8c3d3e00-4995-11ea-9a3f-57ba1a0ff036.png)
if we set like this
Notice above the input are empty, and the Error is :
Must supply a value for form control with name: ***.
Reference
[1] https://angular.io/guide/reactive-forms#patching-the-model-value