Question: What Angular template syntax can you use on this template-driven form field to access the field value and check for validation within the template markup?
- You can make use of a template reference variable and the exportAs feature that the ngModel directive has.
- You can use the ngModel directive in combination with the input field name.
- You can use a template reference variable for the HTML input element and then check the valid property off of that.
- It is not possible to get access to the field value with template-driven forms. You must use reactive forms for that.
Answer: The correct answer of the above question is Option A:You can make use of a template reference variable and the exportAs feature that the ngModel directive has.