I'm creating a "file upload" component in Angular and I'd like to mark it as invalid during the upload. Indeed, when the user selects a file, it gets uploaded to the server but during that period of time, I don't want the user to be able to submit the form, so I'd like to set the validity state of the control to "invalid" when the upload starts and to "valid" when the upload is done.
I read that I can implement the interface Validator
but it seems to me that the validate
method gets called by Angular and not by me, so I can't mark the control as invalid as I want.