Angular JS Validation - How to turn off required for a single field
<p>I'm trying to turn off the required attribute for a single input field in an Angular form on submit, if a certain condition is not met. I have tried the following:</p>

<pre><code>form.ChangeCreditCard.$setValidity("required", false);
</code></pre>

<p>And even manually setting the $valid state for the field:</p>

<pre><code>form.ChangeCreditCard.$valid = true;
</code></pre>

<p>But the field and thus the form is still invalid. Is there any way I could turn off validation on a single field in this way?</p>