I have some simple angular 2 component with template. How to clear form and all fields after submit?. I can\'t reload page.
After set data with date.setValue(\'\')>
// you can put this method in a module and reuse it as needed
resetForm(form: FormGroup) {
form.reset();
Object.keys(form.controls).forEach(key => {
form.get(key).setErrors(null) ;
});
}