title: ng-show expression ... how to debug it
body: <p>I have the following code </p>
  
  <pre><code>&lt;span ng-show="form.email.$error.unique"&gt;Email already exists&lt;/span&gt;
  </code></pre>
  
  <p>This is working correctly and I am able to see the span element if the email entered in the "email" input field already exists in our db.</p>
  
  <p>However if I go into chrome console. and then type</p>
  
  <pre><code>form.email.$error
  </code></pre>
  
  <p>it says undefined.</p>
  
  <p>I can type in </p>
  
  <pre><code>form.email 
  </code></pre>
  
  <p>and it shows me </p>
  
  <pre><code>​&lt;input name=​"email" ng-model=​"model.email" required class=​"ng-dirty ng-invalid ng-invalid-unique"&gt;
  </code></pre>
  
  <p>So the question is why can't I see $error in chrome console? this value definitely exists because angular is reading it and based on the value it is deciding whether to show the span or not.</p>
  
  <p>Edit:: Upon further reading documentation, I feel that the directive which checks whether email is valid or not... sets the validity on the controller object (4th parameter . $setValidity )</p>
  
  <p>but somehow the UI reads that $error from the UI element .</p>
  
  <p>so that's very confusing as to what is the actual workflow... where is the $error being set and from where it is being read.</p>
  
  <p>Can someone clarify this?</p>