setValue

Using this method completely replaces all the values. As long as you mention all the values that the form was created with then you are fine, like this:

form.setValue({
name: 'chris',
surname: 'noring',
age: 37
})

If however, you forget a field, you will get an error back saying you must specify a value for all fields:

form.setValue({
name: 'chris',
surname: 'noring'
})

If you only wanted to do a partial update then the patchValue() function is for you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset