angular-schema-form icon indicating copy to clipboard operation
angular-schema-form copied to clipboard

Determining when validation is complete

Open AndrewIsh opened this issue 9 years ago • 2 comments

Enhancement

Sending the 'schemaFormValidate' broadcast prompts a validation of the form. However, if you then want to perform an action dependent on the form's $valid property immediately after the validation, there is no way of knowing when the validation is complete. This can lead to a race condition whereby the testing of the form's $valid property occurs before the validation is complete.

Expected behaviour

Either prompting form validation should be done via a method call that returns a promise or, maybe, upon form validation, ASF should send a broadcast announcing the fact.

@json-schema-form/angular-schema-form-lead

AndrewIsh avatar May 13 '16 11:05 AndrewIsh

@AndrewIsh does a scope.$apply(); not wait for it to complete?

Anthropic avatar Feb 28 '17 14:02 Anthropic

@Anthropic I'm not sure how this would be implemented. If I'm sending a schemaFormValidate broadcast, that's a fire and forget. I'm not sure I understand how scope.$apply() could be used in this context. Apologies if I'm being dim ;-)

AndrewIsh avatar Mar 08 '17 11:03 AndrewIsh