In the template I have a form, which one part of it has to do with rendering the list of courses:
The code below worked for me. The '?' after courseCategory is not necessary, however, it's a workaround for a bug in Visual Studio code where the linter flags courseCategory.errors?.required"
as an error stating that 'required is not defined. So for VSCode users, there's the patch until an official one is made.
*ngIf="courseCategory.touched && courseCategory?.errors?.required"