Reputation: 63
How can you keep a form button disabled until form data is filled in reactive form? I have created a reactive form here.
And also how can you reset reactive forms and clear the data after a submit?
Upvotes: 0
Views: 201
Reputation: 880
You could just use the FormGroup object you created "registerForm". This object is really powerful. Check out the documentation on it.
https://angular.io/api/forms/FormGroup
I do this all the time :)
<button [disabled]="!registerForm.valid" class="btn btn-primary">Register</button>
Upvotes: 1