This repository was archived by the owner on Nov 13, 2022. It is now read-only.
Fix error where form validation messages not appearing when expected.#4
Open
alexander89d wants to merge 1 commit intoosu-cascades:masterfrom
Open
Fix error where form validation messages not appearing when expected.#4alexander89d wants to merge 1 commit intoosu-cascades:masterfrom
alexander89d wants to merge 1 commit intoosu-cascades:masterfrom
Conversation
Although form validation messages in the donation form and request form templates were set to appear when a form field had been edited and contained an invalid value (i.e. a user began to fill in and then cleared a field), these messages were not appearing when expected. Each form field previously contained a declaration of a reference variable with identical name, "#name." Now, each field of the template declares a reference variable unique to that field (e.g. "#phoneNumber"), and the div containing the error message uses the unique reference variable to check the state of the field. Error messages now appear as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although form validation messages in the donation form and request form templates were set to appear when a form field had been edited and contained an invalid value (i.e. a user began to fill in and then cleared a field), these messages were not appearing when expected. Each form input tag in the form templates previously contained a declaration of a reference variable with identical name, "#name." Now, each input of each template declares a reference variable unique to that field of that template (e.g. "#phoneNumber"), and the div containing the error message uses the unique reference variable to check the state of the field. Error messages now appear as expected.
Since this error was present in both request-form.component.html and donation-form.component.html, identical changes have been made to each form template.
I based this contribution off of the guidance in the Angular Docs Template Syntax page's "Template Reference Variables" section.