title: Angular - Unable to $setValidity (is not a function)
body: <p>I have an angular app linked to a Rails a backend.
  What I want is to handle Rails validation errors with Angular.</p>
  
  <p>Based on differents tutorials, I did this:</p>
  
  <p><strong>edit.html</strong></p>
  
  <pre><code>&lt;div id="Wrapper" ng-controller="EditCtrl"
    &lt;div class="row margin-top-100"&gt;
        &lt;form name="form"&gt;
          &lt;div&gt;
  
          &lt;!--- FIELD --&gt;
            &lt;input class="field" type="text" ng-blur="update()" ng-model="current.title" name="title"&gt;
          &lt;/div&gt;
        &lt;/form&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>edit.js</strong></p>
  
  <pre><code>.controller('EditCtrl', 
        function($scope, $rootScope, $state, $stateParams, $http, CurrentSpot, $filter, Notification, $modal,$compile, $timeout){
  
      $scope.update = function() {
        $http.put('/c/'+$scope.current.id.$oid, {c: $scope.current})
        .then(function(success) {
  
          $scope.current = success.data;
          Notification.success("Great !")
  
        }, function(error) {
          console.log(error)
          form.title.$setValidity('server', false);
          console.log("FORM", form.title)
        })
      }
  })
  </code></pre>
  
  <p>Which produces this error <code>form.title.$setValidity is not a function</code> in the console when Rails refused the update.</p>
  
  <p>Maybe one more information: <code>console.log("FORM", form)</code> returns:</p>
  
  <pre><code>&lt;input class="field ng-pristine ng-untouched ng-valid ng-not-empty" type="text" ng-blur="update()" ng-model="current.title" name="title" &gt;
  </code></pre>
  
  <p>but <code>{{form.title}}</code> in the view returns: </p>
  
  <pre><code>{
     "$viewValue":"Cc",
     "$modelValue":"Cc",
     "$validators":{
  
     },
     "$asyncValidators":{
  
     },
     "$parsers":[
  
     ],
     "$formatters":[
        null
     ],
     "$viewChangeListeners":[
  
     ],
     "$untouched":true,
     "$touched":false,
     "$pristine":true,
     "$dirty":false,
     "$valid":true,
     "$invalid":false,
     "$error":{
  
     },
     "$name":"title",
     "$options":null
  }
  </code></pre>
  
  <p>After many hours of reading tutorials and documentations, I'm not able to find where the problem comes from. 
  Thanks</p>