Data validation
If we take a look at our current .NET Core with Angular project, we can see how there's good news and there's bad news: the good news is that we already have some decent forms in place--the QuizEditComponent
, QuestionEditComponent
, AnswerEditComponent
, and ResultEditComponent
are nothing more, nothing less than wrappers for forms. They also provide a rather good-looking user experience since the restyling performed in Chapter 6, Style Sheets and UI Layout, do we really need anything else?
The answer is yes. When we first laid down these forms back in Chapter 5, Client-Server Interactions, we entirely skipped the part in which we were supposed to validate the user-submitted data, postponing that task to a not-so-distant future; we don't even have a proper <form>
element in our templates! Well, guess what? The time has finally come.
Forms in Angular
Let's try to summarize the most blatant shortages of our current form-less approach:
- We cannot keep track of the global form...