Manipulating form data
setValue: Replaces values in all the controls of the form
patchValue: Updates values in specific controls of the form
setValue method accepts an object as a parameter that contains key-value pairs for all form controls. If we want to fill in the details of a product in the product create component programmatically, we should use the following snippet:
name: 'New product',
In the preceding snippet, each key of the object passed in the
setValue method must match the name of each control in the form. If we omit one, Angular will throw an error.