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(\'\')>
I found another solution. It's a bit hacky but its widely available in angular2 world.
Since *ngIf directive removes the form and recreates it, one can simply add an *ngIf to the form and bind it to some sort of formSuccessfullySentvariable. => This will recreate the form and therefore reset the input control statuses.
Of course, you have to clear the model variables also. I found it convenient to have a specific model class for my form fields. This way i can reset all fields as simple as creating a new instance of this model class. :)