title: $scope.form.$error is undefined in Angular controller
body: <p>I'm trying to iterate through all fields that are required and blank in an Angular controller (it's triggered by a certain button being pressed).</p>
  
  <p>I've got this sitting in the controller:</p>
  
  <pre><code>angular.forEach($scope.form.$error.required, function (field) {
          //Do some things to these fields
      });
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/27503281/1736597">From here</a></p>
  
  <p>The problem is that I get </p>
  
  <pre><code>TypeError: Cannot read property 'required' of undefined
  </code></pre>
  
  <p>And in Chrome dev tools <code>$scope.form.$error</code> is undefined. I've confirmed that $scope.form is populated as expected.</p>
  
  <p>I think I'm missing something simple, but not sure what it is.</p>