bind different value to ng-model on some condition
<p>I have started using Angular and don't have much experience in it.<br>
I am stuck with an issue. I am using <code>ng-show</code> and <code>ng-model</code>.</p>

<p>its like</p>

<pre><code>&lt;tr ng-show="responseValid"&gt;
  &lt;td&gt; &lt;input id="nameId" ng-model="model.name"/&gt; &lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>I am pre-populating the value in <code>model.name</code>.</p>

<p>Now if response is valid the input tag is shown otherwise not.</p>

<p>but when I <code>submit</code> the form, <code>nameId</code> value is bind by <code>ng-model="model.name</code>"</p>

<p>Issue here is I want <code>model.name</code> should not contain any value if response is not Valid i.e when input tag is hidden. but its not happening.</p>

<p>How can I <code>nullify/empty</code> the value in <code>model.name</code>? Is there anything available that I can use in the tag itself?</p>